feat: add cudaSupport option for mkNixOS
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
129aa3224e
commit
72611337ab
2 changed files with 76 additions and 42 deletions
|
@ -1,9 +1,16 @@
|
|||
inputs: rec {
|
||||
# Import pkgs from a nixpkgs instance
|
||||
mkPkgs = system: nixpkgs:
|
||||
mkPkgs = {
|
||||
system,
|
||||
nixpkgs,
|
||||
cudaSupport ? false,
|
||||
}:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
inherit cudaSupport;
|
||||
};
|
||||
overlays =
|
||||
(map (i: inputs.${i}.overlays.default) [
|
||||
"discord-overlay"
|
||||
|
@ -21,28 +28,37 @@ inputs: rec {
|
|||
};
|
||||
|
||||
# Function that makes the attrs that make up the specialArgs
|
||||
mkArgs = system:
|
||||
mkArgs = {
|
||||
system,
|
||||
cudaSupport ? false,
|
||||
}:
|
||||
inputs
|
||||
// {
|
||||
pkgs = mkPkgs system inputs.nixpkgs;
|
||||
pkgs = mkPkgs {
|
||||
inherit system cudaSupport;
|
||||
inherit (inputs) nixpkgs;
|
||||
};
|
||||
};
|
||||
|
||||
# Default system
|
||||
mkNixOS = mods:
|
||||
mkNixOS = {
|
||||
extraModules ? [],
|
||||
cudaSupport ? false,
|
||||
}:
|
||||
inputs.nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = mkArgs system;
|
||||
specialArgs = mkArgs {inherit system cudaSupport;};
|
||||
modules =
|
||||
[
|
||||
{home-manager.extraSpecialArgs = specialArgs;}
|
||||
../common
|
||||
]
|
||||
++ mods;
|
||||
++ extraModules;
|
||||
};
|
||||
|
||||
mkNixOnDroid = mods:
|
||||
inputs.nix-on-droid.lib.nixOnDroidConfiguration rec {
|
||||
extraSpecialArgs = mkArgs "aarch64-linux";
|
||||
extraSpecialArgs = mkArgs {system = "aarch64-linux";};
|
||||
home-manager-path = inputs.home-manager.outPath;
|
||||
pkgs = extraSpecialArgs.pkgs;
|
||||
|
||||
|
|
86
outputs.nix
86
outputs.nix
|
@ -57,7 +57,7 @@
|
|||
|
||||
perSystem = attrs:
|
||||
nixpkgs.lib.genAttrs (import systems) (system:
|
||||
attrs (mkPkgs system nixpkgs));
|
||||
attrs (mkPkgs {inherit system nixpkgs;}));
|
||||
in {
|
||||
nixosModules = import ./nixosModules self;
|
||||
|
||||
|
@ -65,49 +65,67 @@
|
|||
|
||||
nixosConfigurations = {
|
||||
# Desktops
|
||||
wim = mkNixOS [
|
||||
./devices/wim
|
||||
secrets.nixosModules.default
|
||||
];
|
||||
binto = mkNixOS [./devices/binto];
|
||||
wim = mkNixOS {
|
||||
extraModules = [
|
||||
./devices/wim
|
||||
secrets.nixosModules.default
|
||||
];
|
||||
};
|
||||
binto = mkNixOS {
|
||||
# FIXME: https://github.com/NixOS/nixpkgs/issues/338315
|
||||
# cudaSupport = true;
|
||||
extraModules = [./devices/binto];
|
||||
};
|
||||
|
||||
bbsteamie = mkNixOS [./devices/bbsteamie];
|
||||
bbsteamie = mkNixOS {extraModules = [./devices/bbsteamie];};
|
||||
|
||||
# NAS
|
||||
nos = mkNixOS [
|
||||
./devices/nos
|
||||
secrets.nixosModules.nos
|
||||
];
|
||||
nos = mkNixOS {
|
||||
# FIXME: https://github.com/NixOS/nixpkgs/issues/338315
|
||||
# cudaSupport = true;
|
||||
extraModules = [
|
||||
./devices/nos
|
||||
secrets.nixosModules.nos
|
||||
];
|
||||
};
|
||||
|
||||
# Build / test server
|
||||
servivi = mkNixOS [
|
||||
./devices/servivi
|
||||
secrets.nixosModules.servivi
|
||||
];
|
||||
servivi = mkNixOS {
|
||||
extraModules = [
|
||||
./devices/servivi
|
||||
secrets.nixosModules.servivi
|
||||
];
|
||||
};
|
||||
|
||||
# Home-assistant
|
||||
homie = mkNixOS [./devices/homie];
|
||||
homie = mkNixOS {extraModules = [./devices/homie];};
|
||||
|
||||
# Cluster
|
||||
thingone = mkNixOS [
|
||||
(import ./devices/cluster "thingone")
|
||||
secrets.nixosModules.thingy
|
||||
];
|
||||
thingtwo = mkNixOS [
|
||||
(import ./devices/cluster "thingtwo")
|
||||
secrets.nixosModules.thingy
|
||||
];
|
||||
thingone = mkNixOS {
|
||||
extraModules = [
|
||||
(import ./devices/cluster "thingone")
|
||||
secrets.nixosModules.thingy
|
||||
];
|
||||
};
|
||||
thingtwo = mkNixOS {
|
||||
extraModules = [
|
||||
(import ./devices/cluster "thingtwo")
|
||||
secrets.nixosModules.thingy
|
||||
];
|
||||
};
|
||||
|
||||
live-image = mkNixOS [
|
||||
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
|
||||
{home-manager.users.nixos.home.stateVersion = "24.05";}
|
||||
{
|
||||
vars = {
|
||||
mainUser = "nixos";
|
||||
hostName = "nixos";
|
||||
};
|
||||
}
|
||||
];
|
||||
live-image = mkNixOS {
|
||||
extraModules = [
|
||||
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
|
||||
{home-manager.users.nixos.home.stateVersion = "24.05";}
|
||||
{
|
||||
vars = {
|
||||
mainUser = "nixos";
|
||||
hostName = "nixos";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nixOnDroidConfigurations.default =
|
||||
|
|
Loading…
Reference in a new issue