refactoring: Use flake-inputs instead of awkwardly passing through
This commit is contained in:
parent
b7feffc52f
commit
bb397841ee
|
@ -3,9 +3,13 @@
|
|||
pkgs,
|
||||
lib,
|
||||
modulesPath,
|
||||
flake-inputs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
flake-inputs.sops-nix.nixosModules.sops
|
||||
flake-inputs.tlaternet-webserver.nixosModules.default
|
||||
|
||||
"${modulesPath}/profiles/headless.nix"
|
||||
"${modulesPath}/profiles/minimal.nix"
|
||||
(import ../modules)
|
||||
|
|
27
flake.nix
27
flake.nix
|
@ -24,8 +24,8 @@
|
|||
sops-nix,
|
||||
nvfetcher,
|
||||
deploy-rs,
|
||||
tlaternet-webserver,
|
||||
}: let
|
||||
...
|
||||
} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
in {
|
||||
##################
|
||||
|
@ -33,9 +33,14 @@
|
|||
##################
|
||||
nixosConfigurations = {
|
||||
# The actual system definition
|
||||
tlaternet = self.lib.makeNixosSystem {
|
||||
tlaternet = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
extraModules = [(import ./configuration/hardware-specific/linode)];
|
||||
specialArgs.flake-inputs = inputs;
|
||||
|
||||
modules = [
|
||||
./configuration
|
||||
./configuration/hardware-specific/linode
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -63,19 +68,21 @@
|
|||
####################
|
||||
# Helper functions #
|
||||
####################
|
||||
lib = import ./lib {
|
||||
inherit nixpkgs sops-nix tlaternet-webserver;
|
||||
lib = nixpkgs.lib;
|
||||
};
|
||||
lib = import ./lib {inherit (nixpkgs) lib;};
|
||||
|
||||
###################
|
||||
# Utility scripts #
|
||||
###################
|
||||
packages.${system} = let
|
||||
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
|
||||
vm = self.lib.makeNixosSystem {
|
||||
vm = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
extraModules = [(import ./configuration/hardware-specific/vm.nix)];
|
||||
specialArgs.flake-inputs = inputs;
|
||||
|
||||
modules = [
|
||||
./configuration
|
||||
./configuration/hardware-specific/vm.nix
|
||||
];
|
||||
};
|
||||
in {
|
||||
default = vm.config.system.build.vm;
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
lib,
|
||||
nixpkgs,
|
||||
sops-nix,
|
||||
tlaternet-webserver,
|
||||
}: let
|
||||
{lib}: let
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
in {
|
||||
|
@ -12,19 +7,4 @@ in {
|
|||
(mapAttrsToList
|
||||
(host: vm: "hostfwd=::${host}-:${vm}")
|
||||
portMapping);
|
||||
|
||||
makeNixosSystem = {
|
||||
system,
|
||||
extraModules,
|
||||
}:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules =
|
||||
[
|
||||
sops-nix.nixosModules.sops
|
||||
tlaternet-webserver.nixosModules.default
|
||||
(import ../configuration)
|
||||
]
|
||||
++ extraModules;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue