summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix120
1 files changed, 72 insertions, 48 deletions
diff --git a/flake.nix b/flake.nix
index c08c546..c85edbc 100644
--- a/flake.nix
+++ b/flake.nix
@@ -21,60 +21,84 @@
};
};
- outputs = { self, nixpkgs, sops-nix, home-manager, nixos-hardware, alina }: let
- lib = nixpkgs.lib;
+ outputs =
+ {
+ self,
+ nixpkgs,
+ sops-nix,
+ home-manager,
+ nixos-hardware,
+ alina,
+ }:
+ let
+ lib = nixpkgs.lib;
- makeGlobalImports = host: [
- ./global/common
- ] ++ lib.optional (builtins.pathExists ./global/${host})
- ./global/${host};
+ makeGlobalImports =
+ host:
+ [
+ ./global/common
+ ]
+ ++ lib.optional (builtins.pathExists ./global/${host}) ./global/${host};
- makeHomeImports = host: makeGlobalImports host ++ [
- ./home/common/home.nix
- ] ++ lib.optional (builtins.pathExists ./home/${host})
- ./home/${host}/home.nix;
+ makeHomeImports =
+ host:
+ makeGlobalImports host
+ ++ [
+ ./home/common/home.nix
+ ]
+ ++ lib.optional (builtins.pathExists ./home/${host}) ./home/${host}/home.nix;
- makeNixos = host: system: lib.nixosSystem {
- inherit system;
- specialArgs = { inherit nixos-hardware; };
+ makeNixos =
+ host: system:
+ lib.nixosSystem {
+ inherit system;
+ specialArgs = { inherit nixos-hardware; };
- modules = [
- alina.nixosModules.alina
- sops-nix.nixosModules.sops
+ modules = [
+ alina.nixosModules.alina
+ sops-nix.nixosModules.sops
- ./os/${host}/configuration.nix
- {
- networking.hostName = host;
- nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
- }
+ ./os/${host}/configuration.nix
+ {
+ networking.hostName = host;
+ nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
+ }
- home-manager.nixosModules.home-manager
- ({ config, ... }: let
- username = config.global.userdata.name;
- in {
- home-manager = {
- useGlobalPkgs = true;
- useUserPackages = false;
- users.${username} = { ... }: {
- imports = makeHomeImports host;
- };
- };
- })
- ] ++ (makeGlobalImports host);
- };
+ home-manager.nixosModules.home-manager
+ (
+ { config, ... }:
+ let
+ username = config.global.userdata.name;
+ in
+ {
+ home-manager = {
+ useGlobalPkgs = true;
+ useUserPackages = false;
+ users.${username} =
+ { ... }:
+ {
+ imports = makeHomeImports host;
+ };
+ };
+ }
+ )
+ ] ++ (makeGlobalImports host);
+ };
- makeHome = host: system: home-manager.lib.homeManagerConfiguration {
- pkgs = nixpkgs.legacyPackages.${system};
- modules = makeHomeImports host;
- };
- in
- {
- nixosConfigurations =
- lib.genAttrs [ "cez" "kay" "lia" "fscusat" "dspace" ]
- (host: makeNixos host "x86_64-linux");
+ makeHome =
+ host: system:
+ home-manager.lib.homeManagerConfiguration {
+ pkgs = nixpkgs.legacyPackages.${system};
+ modules = makeHomeImports host;
+ };
+ in
+ {
+ nixosConfigurations = lib.genAttrs [ "cez" "kay" "lia" "fscusat" "dspace" ] (
+ host: makeNixos host "x86_64-linux"
+ );
- homeConfigurations =
- lib.genAttrs [ "common" "wayland" "pc" "cez" ]
- (host: makeHome host "x86_64-linux");
- };
+ homeConfigurations = lib.genAttrs [ "common" "wayland" "pc" "cez" ] (
+ host: makeHome host "x86_64-linux"
+ );
+ };
}