use hardware-configuration.nix as a flake input

This commit is contained in:
Alexander Tomokhov 2023-08-22 23:08:53 +04:00
parent afcec981bc
commit d1d025dda6
4 changed files with 17 additions and 16 deletions

4
.gitignore vendored
View file

@ -1,4 +1,4 @@
userdata/userdata.json
userdata/tokens.json
hardware-configuration.nix
networking.nix
networking.nix
/result

View file

@ -1,7 +1,6 @@
{ userdata, selfprivacy-overlay, config, pkgs, lib, ... }:
{
imports = [
./hardware-configuration.nix
./variables-module.nix
./variables.nix
./files.nix

View file

@ -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 ];
};
};
};

View file

@ -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"; };
}