more work on darwin

This commit is contained in:
ChaotiCryptidz 2022-03-02 17:36:42 +00:00
parent 50cb86227a
commit 7b0310b368
No known key found for this signature in database
4 changed files with 81 additions and 63 deletions

View file

@ -1,61 +1,3 @@
{ self, nixpkgs-unstable, tree, ... }@inputs: {...}@inputs: {
let nixosConfigurations = import ./nixos.nix inputs;
defaultModules = [ }
# NO_INLINE
tree.impure.modules.nixos
tree.impure.profiles.base
];
defaultModulesNixOSUnstable = defaultModules ++ [
# NO_INLINE
inputs.home-manager-unstable.nixosModules.home-manager
];
defaultSpecialArgs = {
tree = tree.impure;
pureTree = tree.pure;
};
defaultSpecialArgsNixOSUnstable = defaultSpecialArgs // {
inputs = inputs // {
# set these to the correct versions from inputs
nixpkgs = inputs.nixpkgs-unstable;
home-manager = inputs.home-manager-unstable;
};
};
nixosUnstableSystem = nixpkgs-unstable.lib.nixosSystem;
in {
lappy = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable
++ [ ./lappy/lappy.nix ./lappy/hardware.nix ];
};
lappy-vm = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable
++ [ ./lappy/lappy.nix ./lappy/vm.nix ];
};
rescue-x86_64 = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable ++ [ ./rescue/rescue.nix ];
};
hetzner-vm = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable ++ [ ./hetzner-vm/hetzner-vm.nix ];
};
# nix --no-sandbox build .#nixosConfigurations.raspberry.config.system.build.sdImage
raspberry = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "aarch64-linux";
modules = defaultModulesNixOSUnstable ++ [ ./raspberry/raspberry.nix ];
};
}

33
hosts/defaults.nix Normal file
View file

@ -0,0 +1,33 @@
{ self, nixpkgs-unstable, tree, ... }@inputs:
let
defaultModules = [
# NO_INLINE
tree.impure.modules.nixos
tree.impure.profiles.base
];
defaultModulesNixOSUnstable = defaultModules ++ [
# NO_INLINE
inputs.home-manager-unstable.nixosModules.home-manager
];
defaultSpecialArgs = {
tree = tree.impure;
pureTree = tree.pure;
};
defaultSpecialArgsNixOSUnstable = defaultSpecialArgs // {
inputs = inputs // {
# set these to the correct versions from inputs
nixpkgs = inputs.nixpkgs-unstable;
home-manager = inputs.home-manager-unstable;
};
};
nixosUnstableSystem = nixpkgs-unstable.lib.nixosSystem;
in {
inherit defaultModules;
inherit defaultModulesNixOSUnstable;
inherit defaultSpecialArgs;
inherit defaultSpecialArgsNixOSUnstable;
}

43
hosts/nixos.nix Normal file
View file

@ -0,0 +1,43 @@
{ self, nixpkgs-unstable, tree, ... }@inputs:
let
defaults = import ./defaults.nix inputs;
defaultModulesNixOSUnstable = defaults.defaultModulesNixOSUnstable;
defaultSpecialArgsNixOSUnstable = defaults.defaultSpecialArgsNixOSUnstable;
nixosUnstableSystem = nixpkgs-unstable.lib.nixosSystem;
in {
lappy = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable
++ [ ./lappy/lappy.nix ./lappy/hardware.nix ];
};
lappy-vm = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable
++ [ ./lappy/lappy.nix ./lappy/vm.nix ];
};
rescue-x86_64 = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable ++ [ ./rescue/rescue.nix ];
};
hetzner-vm = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "x86_64-linux";
modules = defaultModulesNixOSUnstable ++ [ ./hetzner-vm/hetzner-vm.nix ];
};
# nix --no-sandbox build .#nixosConfigurations.raspberry.config.system.build.sdImage
raspberry = nixosUnstableSystem {
specialArgs = defaultSpecialArgsNixOSUnstable;
system = "aarch64-linux";
modules = defaultModulesNixOSUnstable ++ [ ./raspberry/raspberry.nix ];
};
}

View file

@ -39,9 +39,9 @@ let
}; };
}; };
}; };
hosts = import ./hosts ({ inherit tree; } // inputs);
in { in {
#legacyPackages.tree = tree; nixosConfigurations = hosts.nixosConfigurations;
nixosConfigurations = import ./hosts ({ inherit tree; } // inputs);
devShell."x86_64-linux" = pkgs-x86_64-linux.mkShell { devShell."x86_64-linux" = pkgs-x86_64-linux.mkShell {
packages = with pkgs-x86_64-linux; [ packages = with pkgs-x86_64-linux; [