mirror of
https://forge.darkest.space/mara/nixos-configs.git
synced 2026-11-21 12:04:24 +01:00
first building version of lpt2 as flake
This commit is contained in:
parent
31e80e7401
commit
b71f8ee636
44 changed files with 396 additions and 677 deletions
15
README.md
15
README.md
|
|
@ -1,15 +0,0 @@
|
||||||
# nixos-configuration
|
|
||||||
|
|
||||||
```
|
|
||||||
/
|
|
||||||
├── modules
|
|
||||||
│ ├── desktop
|
|
||||||
│ ├── hardware (includes hostname.nix)
|
|
||||||
│ └── users
|
|
||||||
└── hostname.nix (imports modules)
|
|
||||||
```
|
|
||||||
|
|
||||||
When adding a new host: `ln -s ./new-devicename.nix /etc/nixos/configuration.nix`
|
|
||||||
|
|
||||||
Use `sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager` to add home manager support.
|
|
||||||
|
|
||||||
8
common/default.nix
Normal file
8
common/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./nixpkgs.nix
|
||||||
|
./globalinstalls.nix
|
||||||
|
./i18n.nix
|
||||||
|
./networking.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -9,5 +9,15 @@
|
||||||
KbdInteractiveAuthentication = false;
|
KbdInteractiveAuthentication = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.tailscale = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
checkReversePath = "loose";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
46
common/nixpkgs.nix
Normal file
46
common/nixpkgs.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options.my.allowUnfreePackages = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [];
|
||||||
|
example = ["steam"];
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
nixpkgs.config = {
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085
|
||||||
|
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.my.allowUnfreePackages;
|
||||||
|
};
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
settings = {
|
||||||
|
substituters = ["https://nix-community.cachix.org" "https://cache.nixos.org/"];
|
||||||
|
trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="];
|
||||||
|
};
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "daily";
|
||||||
|
options = "--delete-older-than 7d";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
system = {
|
||||||
|
stateVersion = "22.11";
|
||||||
|
# enable auto updates
|
||||||
|
autoUpgrade = {
|
||||||
|
enable = true;
|
||||||
|
dates = "weekly";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
documentation = {
|
||||||
|
enable = true; # documentation of packages
|
||||||
|
nixos.enable = false; # nixos documentation
|
||||||
|
man.enable = true; # manual pages and the man command
|
||||||
|
info.enable = false; # info pages and the info command
|
||||||
|
doc.enable = false; # documentation distributed in packages' /share/doc
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
133
flake.lock
generated
Normal file
133
flake.lock
generated
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1726560853,
|
||||||
|
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flakey-profile": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712898590,
|
||||||
|
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
|
||||||
|
"owner": "lf-",
|
||||||
|
"repo": "flakey-profile",
|
||||||
|
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "lf-",
|
||||||
|
"repo": "flakey-profile",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1726989464,
|
||||||
|
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-24.05",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lix": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1729298361,
|
||||||
|
"narHash": "sha256-hiGtfzxFkDc9TSYsb96Whg0vnqBVV7CUxyscZNhed0U=",
|
||||||
|
"rev": "ad9d06f7838a25beec425ff406fe68721fef73be",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ad9d06f7838a25beec425ff406fe68721fef73be.tar.gz?rev=ad9d06f7838a25beec425ff406fe68721fef73be"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/lix-project/lix/archive/2.91.1.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lix-module": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"flakey-profile": "flakey-profile",
|
||||||
|
"lix": "lix",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1729360442,
|
||||||
|
"narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=",
|
||||||
|
"rev": "9098ac95768f7006d7e070b88bae76939f6034e6",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1729691686,
|
||||||
|
"narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "32e940c7c420600ef0d1ef396dc63b04ee9cad37",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-24.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"lix-module": "lix-module",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
32
flake.nix
Normal file
32
flake.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/release-24.05";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
lix-module = {
|
||||||
|
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs @ {
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
lix-module,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
nixosConfigurations = {
|
||||||
|
vinzenz-lpt2 = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
lix-module.nixosModules.default
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
./common
|
||||||
|
./hosts/vinzenz-lpt2
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
14
home/default.nix
Normal file
14
home/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
config = {
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
sharedModules = import ./shared-modules.nix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,10 +3,8 @@
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
isEnabled = config.my.desktop.enableGnome;
|
config = {
|
||||||
in {
|
|
||||||
config = lib.mkIf isEnabled {
|
|
||||||
home-manager.sharedModules = [
|
home-manager.sharedModules = [
|
||||||
{
|
{
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs;
|
||||||
|
|
@ -87,7 +85,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
(lib.mkIf config.my.tailscale.enable
|
|
||||||
{
|
{
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs;
|
||||||
[
|
[
|
||||||
|
|
@ -97,7 +95,7 @@ in {
|
||||||
tailscale-qs
|
tailscale-qs
|
||||||
]);
|
]);
|
||||||
dconf.settings."org/gnome/shell".enabled-extensions = ["tailscale@joaophi.github.com"];
|
dconf.settings."org/gnome/shell".enabled-extensions = ["tailscale@joaophi.github.com"];
|
||||||
})
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -1,28 +1,10 @@
|
||||||
modulesCfg: {
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
isEnabled = config.my.desktop.enable;
|
config = {
|
||||||
isHomeManager = modulesCfg.enableHomeManager;
|
|
||||||
in {
|
|
||||||
imports =
|
|
||||||
[
|
|
||||||
./gnome.nix
|
|
||||||
./kde.nix
|
|
||||||
./gaming.nix
|
|
||||||
./printing.nix
|
|
||||||
./latex.nix
|
|
||||||
]
|
|
||||||
++ lib.optionals isHomeManager [
|
|
||||||
./gnome-home.nix
|
|
||||||
./kde-home.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
options.my.desktop.enable = lib.mkEnableOption "desktop";
|
|
||||||
|
|
||||||
config = lib.mkIf isEnabled {
|
|
||||||
services = {
|
services = {
|
||||||
# Enable the X11 windowing system / wayland depending on DE
|
# Enable the X11 windowing system / wayland depending on DE
|
||||||
xserver = {
|
xserver = {
|
||||||
|
|
@ -3,12 +3,8 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
isEnabled = config.my.hardware.enableCommonDesktopSettings;
|
config = {
|
||||||
in {
|
|
||||||
options.my.hardware.enableCommonDesktopSettings = lib.mkEnableOption "common hw settings for desktops";
|
|
||||||
|
|
||||||
config = lib.mkIf isEnabled {
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackages_zen;
|
kernelPackages = pkgs.linuxPackages_zen;
|
||||||
kernelParams = ["quiet" "udev.log_level=3"];
|
kernelParams = ["quiet" "udev.log_level=3"];
|
||||||
|
|
@ -3,12 +3,8 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
isEnabled = config.my.desktop.enableGaming;
|
config = {
|
||||||
in {
|
|
||||||
options.my.desktop.enableGaming = lib.mkEnableOption "gaming with wine";
|
|
||||||
|
|
||||||
config = lib.mkIf isEnabled {
|
|
||||||
hardware = {
|
hardware = {
|
||||||
opengl = {
|
opengl = {
|
||||||
driSupport = true;
|
driSupport = true;
|
||||||
|
|
@ -3,14 +3,8 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
isEnabled = config.my.desktop.enableGnome;
|
config = {
|
||||||
in {
|
|
||||||
options.my.desktop.enableGnome = lib.mkEnableOption "gnome desktop";
|
|
||||||
|
|
||||||
config = lib.mkIf isEnabled {
|
|
||||||
my.desktop.enable = true;
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
xserver = {
|
xserver = {
|
||||||
# Enable the GNOME Desktop Environment.
|
# Enable the GNOME Desktop Environment.
|
||||||
28
hosts/intel-graphics.nix
Normal file
28
hosts/intel-graphics.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
config = {
|
||||||
|
hardware.opengl = {
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
intel-media-driver
|
||||||
|
vaapiIntel
|
||||||
|
vaapiVdpau
|
||||||
|
libvdpau-va-gl
|
||||||
|
intel-ocl
|
||||||
|
];
|
||||||
|
extraPackages32 = with pkgs.pkgsi686Linux; [
|
||||||
|
intel-media-driver
|
||||||
|
vaapiIntel
|
||||||
|
vaapiVdpau
|
||||||
|
libvdpau-va-gl
|
||||||
|
];
|
||||||
|
};
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nvtopPackages.intel
|
||||||
|
];
|
||||||
|
my.allowUnfreePackages = ["intel-ocl"];
|
||||||
|
};
|
||||||
|
}
|
||||||
14
hosts/latex.nix
Normal file
14
hosts/latex.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
config = {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
fontconfig
|
||||||
|
texliveFull
|
||||||
|
texstudio
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,12 +3,8 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
isEnabled = config.my.desktop.enablePrinting;
|
config = {
|
||||||
in {
|
|
||||||
options.my.desktop.enablePrinting = lib.mkEnableOption "printing";
|
|
||||||
|
|
||||||
config = lib.mkIf isEnabled {
|
|
||||||
services = {
|
services = {
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue