diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2021-02-20 19:03:41 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2021-02-20 19:03:41 -0500 |
commit | 4fc459d19e37406975162637e1fad9e50bfb61a3 (patch) | |
tree | b4b581b97f2916e8b06d535d6a5b500255855565 | |
parent | a6f89b08d287271bca069bb8c6e7e011d49da882 (diff) |
Add flake config for pincer
-rw-r--r-- | flake.lock | 44 | ||||
-rw-r--r-- | flake.nix | 28 | ||||
-rw-r--r-- | machines/x1-pincer.nix | 7 |
3 files changed, 78 insertions, 1 deletions
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4f9e088 --- /dev/null +++ b/flake.lock @@ -0,0 +1,44 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1613772719, + "narHash": "sha256-jZ6KiCOaDOZJHMDFnBO1fHPrDqDUmOkihPWXavyGa98=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "38eaa62f28384bc5f6c394e2a99bd6a4913fc71f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-20.09", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_unstable": { + "locked": { + "lastModified": 1613761605, + "narHash": "sha256-lUF6UPR96ZzQC0faNXBHLoLhNAdxZqYqDwz0PaIZ/7Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9816b99e71c3504b0b4c1f8b2e004148460029d4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs_unstable": "nixpkgs_unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..44d5cc5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09"; + inputs.nixpkgs_unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs, nixpkgs_unstable }: { + + nixosConfigurations = let + mkConfig = { hostName, module }: { + name = hostName; + value = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = + [ module + ({...}: { + # Let 'nixos-version --json' know about the Git revision + # of this flake. + system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + }) + ]; + }; + }; + myMachines = [ + { hostName = "pincer"; module = ./machines/x1-pincer.nix; } + ]; + in builtins.listToAttrs (map mkConfig myMachines); + + }; +} diff --git a/machines/x1-pincer.nix b/machines/x1-pincer.nix index 59d1e12..ec6fe50 100644 --- a/machines/x1-pincer.nix +++ b/machines/x1-pincer.nix @@ -34,7 +34,7 @@ let ports = { }; loader.efi.canTouchEfiVariables = true; kernelPackages = pkgs.linuxPackages_latest; - kernelModules = ["xpad"]; + kernelModules = ["xpad" "kvm-intel" ]; initrd.luks.devices = { cryptroot = { @@ -77,4 +77,9 @@ let ports = { item = "nofile"; value = "1048576"; }]; + + # hardware-configuration.nix + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "sd_mod" ]; + nix.maxJobs = lib.mkDefault 4; + hardware.enableRedistributableFirmware = lib.mkDefault true; } |