do not provide default nixosModule
This commit is contained in:
parent
c0d650d54f
commit
3ba30b1a6d
3 changed files with 35 additions and 44 deletions
64
flake.nix
64
flake.nix
|
@ -74,20 +74,26 @@
|
||||||
"vinzenz-pc2"
|
"vinzenz-pc2"
|
||||||
"ronja-pc"
|
"ronja-pc"
|
||||||
];
|
];
|
||||||
forDevice = f: nixpkgs.lib.mapAttrs f devices;
|
lib = nixpkgs.lib;
|
||||||
|
forDevice = f: lib.mapAttrs f devices;
|
||||||
supported-systems = [
|
supported-systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
];
|
];
|
||||||
forAllSystems =
|
forAllSystems =
|
||||||
f:
|
f:
|
||||||
nixpkgs.lib.genAttrs supported-systems (
|
lib.genAttrs supported-systems (
|
||||||
system:
|
system:
|
||||||
f rec {
|
f rec {
|
||||||
inherit system;
|
inherit system;
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
importDir =
|
||||||
|
dir:
|
||||||
|
(lib.attrsets.mapAttrs' (
|
||||||
|
m: _: lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) (import "${dir}/${m}")
|
||||||
|
) (builtins.readDir dir));
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
nixosConfigurations = forDevice (
|
nixosConfigurations = forDevice (
|
||||||
|
@ -109,12 +115,17 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
self.nixosModules.default
|
|
||||||
|
|
||||||
./hosts/${device}/hardware.nix
|
./hosts/${device}/hardware.nix
|
||||||
./hosts/${device}/imports.nix
|
./hosts/${device}/imports.nix
|
||||||
./hosts/${device}/configuration.nix
|
./hosts/${device}/configuration.nix
|
||||||
|
|
||||||
|
self.nixosModules.lix-is-nix
|
||||||
|
self.nixosModules.globalinstalls
|
||||||
|
self.nixosModules.autoupdate
|
||||||
|
self.nixosModules.openssh
|
||||||
|
./modules/networking.nix
|
||||||
|
./modules/nixpkgs.nix
|
||||||
|
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
overlays.unstable-packages
|
overlays.unstable-packages
|
||||||
|
@ -123,12 +134,22 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [
|
++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [
|
||||||
self.nixosModules.desktopDefault
|
|
||||||
{
|
{
|
||||||
home-manager.extraSpecialArgs = specialArgs;
|
home-manager.extraSpecialArgs = specialArgs;
|
||||||
|
|
||||||
time.timeZone = "Europe/Berlin";
|
time.timeZone = "Europe/Berlin";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.nixosModules.pkgs-unstable
|
||||||
|
self.nixosModules.niri
|
||||||
|
self.nixosModules.kdeconnect
|
||||||
|
self.nixosModules.en-de
|
||||||
|
./modules/home-manager.nix
|
||||||
|
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
servicepoint-simulator.nixosModules.default
|
||||||
|
servicepoint-cli.nixosModules.default
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -146,14 +167,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules =
|
nixosModules = (importDir ./nixosModules) // {
|
||||||
let
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
in
|
|
||||||
(lib.attrsets.mapAttrs' (
|
|
||||||
m: _: lib.attrsets.nameValuePair (lib.strings.removeSuffix ".nix" m) (import ./nixosModules/${m})
|
|
||||||
) (builtins.readDir ./nixosModules))
|
|
||||||
// {
|
|
||||||
niri = {
|
niri = {
|
||||||
imports = [ niri.nixosModules.niri ];
|
imports = [ niri.nixosModules.niri ];
|
||||||
nixpkgs.overlays = [ niri.overlays.niri ];
|
nixpkgs.overlays = [ niri.overlays.niri ];
|
||||||
|
@ -161,30 +175,6 @@
|
||||||
pkgs-unstable = {
|
pkgs-unstable = {
|
||||||
nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ];
|
nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ];
|
||||||
};
|
};
|
||||||
desktopDefault = {
|
|
||||||
imports = [
|
|
||||||
self.nixosModules.pkgs-unstable
|
|
||||||
self.nixosModules.niri
|
|
||||||
self.nixosModules.kdeconnect
|
|
||||||
self.nixosModules.en-de
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
servicepoint-simulator.nixosModules.default
|
|
||||||
servicepoint-cli.nixosModules.default
|
|
||||||
|
|
||||||
./modules/home-manager.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
default = {
|
|
||||||
imports = with self.nixosModules; [
|
|
||||||
lix
|
|
||||||
globalinstalls
|
|
||||||
autoupdate
|
|
||||||
openssh
|
|
||||||
./modules/networking.nix
|
|
||||||
./modules/nixpkgs.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree);
|
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree);
|
||||||
|
|
|
@ -11,5 +11,6 @@
|
||||||
system.autoUpgrade = {
|
system.autoUpgrade = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dates = "daily";
|
dates = "daily";
|
||||||
|
# do not forget to set `flake` when using this module!
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue