mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
funnier abstractions
This commit is contained in:
parent
66091358d5
commit
e30687954a
6 changed files with 40 additions and 34 deletions
|
|
@ -200,4 +200,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
|
networking.hostName = "gerg-desktop";
|
||||||
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,4 +39,8 @@
|
||||||
edition = lib.mkForce "gerg-minimal";
|
edition = lib.mkForce "gerg-minimal";
|
||||||
isoName = lib.mkForce "NixOS";
|
isoName = lib.mkForce "NixOS";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
networking.hostName = "gerg-iso";
|
||||||
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
|
networking.hostName = "media-laptop";
|
||||||
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@
|
||||||
programs.command-not-found.enable = false;
|
programs.command-not-found.enable = false;
|
||||||
programs.nano.enable = false;
|
programs.nano.enable = false;
|
||||||
###
|
###
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -167,39 +167,45 @@ rec {
|
||||||
(lib.foldAttrs lib.mergeAttrs { })
|
(lib.foldAttrs lib.mergeAttrs { })
|
||||||
];
|
];
|
||||||
|
|
||||||
mkHosts =
|
mkHosts = wrench [
|
||||||
system:
|
builtins.readDir
|
||||||
lib.flip lib.genAttrs (
|
(lib.filterAttrs (_: v: v == "directory"))
|
||||||
hostName:
|
builtins.attrNames
|
||||||
# Whats lib.nixosSystem? never heard of her
|
(map (x: {
|
||||||
lib.evalModules {
|
name = x;
|
||||||
|
value = lib.evalModules {
|
||||||
specialArgs.modulesPath = "${unstable}/nixos/modules";
|
specialArgs.modulesPath = "${unstable}/nixos/modules";
|
||||||
|
|
||||||
modules = builtins.concatLists [
|
modules = builtins.concatLists [
|
||||||
(builtins.attrValues self.nixosModules)
|
(builtins.attrValues self.nixosModules)
|
||||||
(map addSchizophreniaToModule (listNixFilesRecursive "${self}/hosts/${hostName}"))
|
(map addSchizophreniaToModule (listNixFilesRecursive "${self}/hosts/${x}"))
|
||||||
(import "${unstable}/nixos/modules/module-list.nix")
|
(import "${unstable}/nixos/modules/module-list.nix")
|
||||||
(lib.singleton {
|
(lib.optionals (self.diskoConfigurations ? "disko-${x}") [
|
||||||
networking = {
|
self.diskoConfigurations."disko-${x}"
|
||||||
inherit hostName;
|
|
||||||
};
|
|
||||||
nixpkgs.hostPlatform = system;
|
|
||||||
})
|
|
||||||
(lib.optionals (self.diskoConfigurations ? "disko-${hostName}") [
|
|
||||||
self.diskoConfigurations."disko-${hostName}"
|
|
||||||
disko.nixosModules.default
|
disko.nixosModules.default
|
||||||
])
|
])
|
||||||
];
|
];
|
||||||
}
|
};
|
||||||
);
|
|
||||||
mkDisko = wrench [
|
|
||||||
(map (name: {
|
|
||||||
name = "disko-${name}";
|
|
||||||
value.disko.devices = import "${self}/disko/${name}.nix" lib;
|
|
||||||
}))
|
}))
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
];
|
];
|
||||||
|
|
||||||
|
mkDisko =
|
||||||
|
path:
|
||||||
|
lib.pipe path [
|
||||||
|
builtins.readDir
|
||||||
|
(lib.filterAttrs (n: v: v == "regular" && lib.hasSuffix ".nix" n))
|
||||||
|
builtins.attrNames
|
||||||
|
(map (x: {
|
||||||
|
name = lib.pipe x [
|
||||||
|
(lib.removeSuffix path)
|
||||||
|
(lib.removeSuffix ".nix")
|
||||||
|
(x: "disko-${x}")
|
||||||
|
];
|
||||||
|
value.disko.devices = import "${path}/${x}" lib;
|
||||||
|
}))
|
||||||
|
builtins.listToAttrs
|
||||||
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
/<name> -> packages named by directory
|
/<name> -> packages named by directory
|
||||||
/<name>/call.nix -> callPackage override imported via import <file> pkgs
|
/<name>/call.nix -> callPackage override imported via import <file> pkgs
|
||||||
|
|
|
||||||
13
outputs.nix
13
outputs.nix
|
|
@ -4,20 +4,11 @@ let
|
||||||
in
|
in
|
||||||
lib.gerg-utils (s: unstable.legacyPackages.${s}) {
|
lib.gerg-utils (s: unstable.legacyPackages.${s}) {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
nixosConfigurations = lib.mkHosts "x86_64-linux" [
|
nixosConfigurations = lib.mkHosts "${self}/hosts";
|
||||||
"gerg-desktop"
|
|
||||||
"media-laptop"
|
|
||||||
"iso"
|
|
||||||
"minecraft"
|
|
||||||
];
|
|
||||||
|
|
||||||
nixosModules = lib.mkModules "${self}/modules";
|
nixosModules = lib.mkModules "${self}/modules";
|
||||||
|
|
||||||
diskoConfigurations = lib.mkDisko [
|
diskoConfigurations = lib.mkDisko "${self}/disko";
|
||||||
"gerg-desktop"
|
|
||||||
"media-laptop"
|
|
||||||
"minecraft"
|
|
||||||
];
|
|
||||||
|
|
||||||
formatter = pkgs: inputs.self.packages.${pkgs.stdenv.system}.lint;
|
formatter = pkgs: inputs.self.packages.${pkgs.stdenv.system}.lint;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue