From 50c554e6e72b45f350af65c12e7fb19a46fc537f Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Wed, 23 Aug 2023 01:41:39 +0400 Subject: [PATCH] don't pass selfprivacy-overlay to configuration.nix; nix flake lock --- configuration.nix | 3 +-- flake.lock | 32 ++++++++++++++++++++++++++++++-- flake.nix | 13 +++++++++---- hardware-configuration.nix | 7 +++++++ 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 hardware-configuration.nix diff --git a/configuration.nix b/configuration.nix index 4f50604..70eee5a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -{ userdata, selfprivacy-overlay, config, pkgs, lib, ... }: +{ userdata, config, pkgs, lib, ... }: { imports = [ ./variables-module.nix @@ -23,7 +23,6 @@ ./git/gitea.nix ]; - nixpkgs.overlays = [ (import selfprivacy-overlay) ]; # this should be specified in hardware-configuration.nix? nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/flake.lock b/flake.lock index b22e171..30c8ef3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,18 @@ { "nodes": { + "hardware-configuration-nix": { + "flake": false, + "locked": { + "lastModified": 1692731346, + "narHash": "sha256-rQIpYKwowqbbVVurEl5qNpuPfoRyEUMefoZXrUoO6p8=", + "path": "hardware-configuration.nix", + "type": "path" + }, + "original": { + "id": "hardware-configuration-nix", + "type": "indirect" + } + }, "nixpkgs": { "locked": { "lastModified": 1686476475, @@ -17,11 +30,13 @@ }, "root": { "inputs": { + "hardware-configuration-nix": "hardware-configuration-nix", "nixpkgs": "nixpkgs", - "selfprivacy-overlay": "selfprivacy-overlay" + "selfprivacy-overlay-path": "selfprivacy-overlay-path", + "userdata-json": "userdata-json" } }, - "selfprivacy-overlay": { + "selfprivacy-overlay-path": { "locked": { "lastModified": 1689554432, "narHash": "sha256-hegMIgxBHUuRFbCecQpbjFfTHpduV3VZWr8OINtQO6k=", @@ -35,6 +50,19 @@ "type": "git", "url": "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo.git" } + }, + "userdata-json": { + "flake": false, + "locked": { + "lastModified": 1689259484, + "narHash": "sha256-Co3QGsxCjDspP5Nzzu1zICkee5CEq+ORlxSF3bFqbCY=", + "path": "userdata/userdata.json", + "type": "path" + }, + "original": { + "id": "userdata-json", + "type": "indirect" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 71273b8..1dfccfb 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; - selfprivacy-overlay.url = + selfprivacy-overlay-path.url = "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nix-repo.git"; # these inputs are expected to be set by the caller @@ -16,20 +16,25 @@ outputs = { self , nixpkgs - , selfprivacy-overlay + , selfprivacy-overlay-path , userdata-json , hardware-configuration-nix }: let system = "x86_64-linux"; + selfprivacy-overlay = import selfprivacy-overlay-path; 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 = [ hardware-configuration ./configuration.nix ]; + specialArgs = { inherit system userdata; }; + modules = [ + { nixpkgs.overlays = [ selfprivacy-overlay ]; } + hardware-configuration + ./configuration.nix + ]; }; }; }; diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..7ac1c80 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,7 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; +}