refactor
This commit is contained in:
parent
0b97b828be
commit
f185ce3c92
3 changed files with 96 additions and 43 deletions
43
flake.nix
43
flake.nix
|
|
@ -33,38 +33,33 @@
|
||||||
stylix,
|
stylix,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
inherit (self) outputs;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
|
defaultConf = rec {
|
||||||
|
uid = 1000;
|
||||||
|
user = "lilith";
|
||||||
|
home = /home/${user};
|
||||||
|
|
||||||
|
tmpfsSize = "4G";
|
||||||
|
|
||||||
|
extraConfig = {};
|
||||||
|
};
|
||||||
|
|
||||||
hosts = builtins.filter (host: builtins.pathExists ./hosts/${host}/configuration.nix) (builtins.attrNames (builtins.readDir ./hosts));
|
hosts = builtins.filter (host: builtins.pathExists ./hosts/${host}/configuration.nix) (builtins.attrNames (builtins.readDir ./hosts));
|
||||||
|
|
||||||
mkHostConfig = host: let
|
importHostConf = host:
|
||||||
defaultConf = rec {
|
lib.recursiveUpdate defaultConf (import ./hosts/${host} inputs
|
||||||
hostname = host;
|
// {
|
||||||
|
hostname = host;
|
||||||
|
hardware-configuration = ./hosts/${host}/hardware-configuration.nix;
|
||||||
|
});
|
||||||
|
|
||||||
uid = 1000;
|
mkHostConfig = host: import ./system (inputs // {conf = importHostConf host;});
|
||||||
user = "lilith";
|
|
||||||
home = /home/${user};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs outputs;
|
|
||||||
conf = defaultConf;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
./hosts/${host}/configuration.nix
|
|
||||||
./hosts/${host}/hardware-configuration.nix
|
|
||||||
impermanence.nixosModule
|
|
||||||
home-manager.nixosModule
|
|
||||||
sops-nix.nixosModules.sops
|
|
||||||
stylix.nixosModules.stylix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = builtins.listToAttrs (
|
nixosConfigurations = builtins.listToAttrs (
|
||||||
map (host: {
|
map (host: {
|
||||||
name = host;
|
name = host;
|
||||||
value = mkHostConfig host;
|
value = (mkHostConfig host).build;
|
||||||
})
|
})
|
||||||
hosts
|
hosts
|
||||||
);
|
);
|
||||||
|
|
|
||||||
28
system/base.nix
Normal file
28
system/base.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
boot.tmp.useTmpfs = true;
|
||||||
|
|
||||||
|
time.timeZone = "Europe/Berlin";
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
age
|
||||||
|
compsize
|
||||||
|
duf
|
||||||
|
eza
|
||||||
|
file
|
||||||
|
htop
|
||||||
|
btop
|
||||||
|
jq
|
||||||
|
yq
|
||||||
|
du-dust
|
||||||
|
ranger
|
||||||
|
ripgrep
|
||||||
|
sops
|
||||||
|
wget
|
||||||
|
wireguard-tools
|
||||||
|
zip
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.pathsToLink = ["/share/zsh"];
|
||||||
|
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
}
|
||||||
|
|
@ -1,21 +1,51 @@
|
||||||
{...}: {
|
{
|
||||||
imports = [
|
conf,
|
||||||
./audio.nix
|
nixpkgs,
|
||||||
./boot.nix
|
home-manager,
|
||||||
./env.nix
|
...
|
||||||
./networking.nix
|
} @ inputs: let
|
||||||
./persistence.nix
|
inherit (conf) system;
|
||||||
./bluetooth.nix
|
|
||||||
./btrfs.nix
|
|
||||||
./fonts.nix
|
|
||||||
./nix.nix
|
|
||||||
./users.nix
|
|
||||||
./ssh.nix
|
|
||||||
./steam.nix
|
|
||||||
./stylix.nix
|
|
||||||
./wayland.nix
|
|
||||||
./zsh.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
pkgs = import nixpkgs {
|
||||||
|
inherit (conf) system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
specialArgs = inputs;
|
||||||
|
in {
|
||||||
|
build = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system pkgs specialArgs;
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
./base.nix
|
||||||
|
|
||||||
|
conf.extraConfig
|
||||||
|
conf.hardware-configuration
|
||||||
|
|
||||||
|
./audio.nix
|
||||||
|
./boot.nix
|
||||||
|
./env.nix
|
||||||
|
./networking.nix
|
||||||
|
./persistence.nix
|
||||||
|
./bluetooth.nix
|
||||||
|
./btrfs.nix
|
||||||
|
./fonts.nix
|
||||||
|
./nix.nix
|
||||||
|
./users.nix
|
||||||
|
./ssh.nix
|
||||||
|
./steam.nix
|
||||||
|
./stylix.nix
|
||||||
|
./wayland.nix
|
||||||
|
./zsh.nix
|
||||||
|
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
({config, ...}: {
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
extraSpecialArgs = specialArgs // {system-config = config;};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue