From d1d025dda6c047ecc2a3612ff5d384c849a24e9b Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Tue, 22 Aug 2023 23:08:53 +0400 Subject: [PATCH] use hardware-configuration.nix as a flake input --- .gitignore | 4 ++-- configuration.nix | 1 - flake.nix | 21 +++++++++++++++------ hardware-configuration.nix | 7 ------- 4 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 hardware-configuration.nix diff --git a/.gitignore b/.gitignore index cc968ec..a0bff95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ userdata/userdata.json userdata/tokens.json -hardware-configuration.nix -networking.nix \ No newline at end of file +networking.nix +/result diff --git a/configuration.nix b/configuration.nix index cfed0c6..4f50604 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,7 +1,6 @@ { userdata, selfprivacy-overlay, config, pkgs, lib, ... }: { imports = [ - ./hardware-configuration.nix ./variables-module.nix ./variables.nix ./files.nix diff --git a/flake.nix b/flake.nix index 46485b3..71273b8 100644 --- a/flake.nix +++ b/flake.nix @@ -2,25 +2,34 @@ description = "Selfprivacy NixOS configuration flake"; inputs = { - #nixpkgs.url = "https://github.com/NixOS/nixpkgs/archive/eef86b8a942913a828b9ef13722835f359deef29.tar.gz"; nixpkgs.url = "github:nixos/nixpkgs"; + selfprivacy-overlay.url = "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo.git"; - userdata-json.url = "path:./userdata.json"; - userdata-json.flake = false; + + # these inputs are expected to be set by the caller + # for example, upon nix build using --override-input + userdata-json.flake = false; # userdata.json + hardware-configuration-nix.flake = false; # hardware-configuration.nix }; - outputs = { self, nixpkgs, selfprivacy-overlay, userdata-json }: + outputs = + { self + , nixpkgs + , selfprivacy-overlay + , userdata-json + , hardware-configuration-nix + }: let system = "x86_64-linux"; userdata = builtins.fromJSON (builtins.readFile userdata-json); + hardware-configuration = import hardware-configuration-nix; in { nixosConfigurations = { just-nixos = nixpkgs.lib.nixosSystem { specialArgs = { inherit system selfprivacy-overlay userdata; }; - - modules = [ ./configuration.nix ]; + modules = [ hardware-configuration ./configuration.nix ]; }; }; }; diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index 7ac1c80..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ modulesPath, ... }: -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.loader.grub.device = "/dev/sda"; - boot.initrd.kernelModules = [ "nvme" ]; - fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; -}