mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 01:17:42 -04:00
More work to just pass around inputs
This commit is contained in:
parent
5ebae303c8
commit
fcfc7be520
1 changed files with 20 additions and 24 deletions
44
flake.nix
44
flake.nix
|
|
@ -74,27 +74,23 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
}; # end inputs
|
}; # end inputs
|
||||||
outputs = inputs@{
|
outputs = inputs@{ self, ... }: let
|
||||||
self, nixpkgs, nixpkgs-unstable, compose2nix, disko, flox, genebean-omp-themes,
|
|
||||||
home-manager, nix-darwin, nix-flatpak, nix-homebrew, nixos-cosmic,
|
|
||||||
nixos-hardware, nixpkgs-terraform, simple-nixos-mailserver, sops-nix, ...
|
|
||||||
}: let
|
|
||||||
# Functions that setup systems
|
# Functions that setup systems
|
||||||
localLib = import ./lib { inherit inputs; };
|
localLib = import ./lib { inherit inputs; };
|
||||||
|
|
||||||
# creates a macOS system config
|
# creates a macOS system config
|
||||||
darwinHostConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: nix-darwin.lib.darwinSystem {
|
darwinHostConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: inputs.nix-darwin.lib.darwinSystem {
|
||||||
pkgs = import nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
permittedInsecurePackages = [ "olm-3.2.16" "python-2.7.18.7" ];
|
permittedInsecurePackages = [ "olm-3.2.16" "python-2.7.18.7" ];
|
||||||
};
|
};
|
||||||
overlays = [ nixpkgs-terraform.overlays.default ];
|
overlays = [ inputs.nixpkgs-terraform.overlays.default ];
|
||||||
};
|
};
|
||||||
specialArgs = { inherit inputs hostname username; } // additionalSpecialArgs;
|
specialArgs = { inherit inputs hostname username; } // additionalSpecialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
nix-homebrew.darwinModules.nix-homebrew {
|
inputs.nix-homebrew.darwinModules.nix-homebrew {
|
||||||
nix-homebrew = {
|
nix-homebrew = {
|
||||||
enable = true; # Install Homebrew under the default prefix
|
enable = true; # Install Homebrew under the default prefix
|
||||||
user = "${username}"; # User owning the Homebrew prefix
|
user = "${username}"; # User owning the Homebrew prefix
|
||||||
|
|
@ -102,13 +98,13 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
home-manager.darwinModules.home-manager {
|
inputs.home-manager.darwinModules.home-manager {
|
||||||
home-manager = {
|
home-manager = {
|
||||||
extraSpecialArgs = { inherit genebean-omp-themes username; };
|
extraSpecialArgs = { inherit inputs username; };
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
users.${username}.imports = [
|
users.${username}.imports = [
|
||||||
sops-nix.homeManagerModule # user-level secrets management
|
inputs.sops-nix.homeManagerModule # user-level secrets management
|
||||||
./modules/home-manager/hosts/${hostname}/${username}.nix
|
./modules/home-manager/hosts/${hostname}/${username}.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
@ -119,15 +115,15 @@
|
||||||
] ++ additionalModules; # end modules
|
] ++ additionalModules; # end modules
|
||||||
}; # end darwinSystem
|
}; # end darwinSystem
|
||||||
|
|
||||||
linuxHomeConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: home-manager.lib.homeManagerConfiguration {
|
linuxHomeConfig = { system, hostname, username, additionalModules, additionalSpecialArgs }: inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
extraSpecialArgs = { inherit genebean-omp-themes hostname username;
|
extraSpecialArgs = { inherit inputs hostname username;
|
||||||
pkgs = import nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
permittedInsecurePackages = [ "olm-3.2.16" "electron-21.4.4" ];
|
permittedInsecurePackages = [ "olm-3.2.16" "electron-21.4.4" ];
|
||||||
};
|
};
|
||||||
overlays = [ nixpkgs-terraform.overlays.default ];
|
overlays = [ inputs.nixpkgs-terraform.overlays.default ];
|
||||||
};
|
};
|
||||||
} // additionalSpecialArgs;
|
} // additionalSpecialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
@ -138,7 +134,7 @@
|
||||||
homeDirectory = "/home/${username}";
|
homeDirectory = "/home/${username}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
] ++ additionalModules;
|
] ++ additionalModules;
|
||||||
}; # end homeManagerConfiguration
|
}; # end homeManagerConfiguration
|
||||||
|
|
||||||
|
|
@ -173,39 +169,39 @@
|
||||||
bigboy = localLib.mkNixosHost {
|
bigboy = localLib.mkNixosHost {
|
||||||
hostname = "bigboy";
|
hostname = "bigboy";
|
||||||
additionalModules = [
|
additionalModules = [
|
||||||
nixos-hardware.nixosModules.lenovo-thinkpad-p52
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p52
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
hetznix01 = localLib.mkNixosHost {
|
hetznix01 = localLib.mkNixosHost {
|
||||||
hostname = "hetznix01";
|
hostname = "hetznix01";
|
||||||
additionalModules = [
|
additionalModules = [
|
||||||
simple-nixos-mailserver.nixosModule
|
inputs.simple-nixos-mailserver.nixosModule
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
hetznix02 = localLib.mkNixosHost {
|
hetznix02 = localLib.mkNixosHost {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
hostname = "hetznix02";
|
hostname = "hetznix02";
|
||||||
additionalModules = [
|
additionalModules = [
|
||||||
# simple-nixos-mailserver.nixosModule
|
# inputs.simple-nixos-mailserver.nixosModule
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
nixnas1 = localLib.mkNixosHost {
|
nixnas1 = localLib.mkNixosHost {
|
||||||
hostname = "nixnas1";
|
hostname = "nixnas1";
|
||||||
additionalModules = [
|
additionalModules = [
|
||||||
simple-nixos-mailserver.nixosModule
|
inputs.simple-nixos-mailserver.nixosModule
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
nixnuc = localLib.mkNixosHost {
|
nixnuc = localLib.mkNixosHost {
|
||||||
hostname = "nixnuc";
|
hostname = "nixnuc";
|
||||||
additionalModules = [
|
additionalModules = [
|
||||||
simple-nixos-mailserver.nixosModule
|
inputs.simple-nixos-mailserver.nixosModule
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
rainbow-planet = localLib.mkNixosHost {
|
rainbow-planet = localLib.mkNixosHost {
|
||||||
hostname = "rainbow-planet";
|
hostname = "rainbow-planet";
|
||||||
additionalModules = [
|
additionalModules = [
|
||||||
nixos-cosmic.nixosModules.default
|
inputs.nixos-cosmic.nixosModules.default
|
||||||
nixos-hardware.nixosModules.dell-xps-13-9360
|
inputs.nixos-hardware.nixosModules.dell-xps-13-9360
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}; # end nixosConfigurations
|
}; # end nixosConfigurations
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue