From 0f687ac0289b9d6402ebd595f84b774a7294aab9 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sun, 7 Mar 2021 15:40:52 -0500 Subject: Fix errors --- flake.nix | 35 ++++++++++++++++++++++++----------- machines/dragon.nix | 2 -- machines/firelink.nix | 9 ++------- machines/x1-pincer.nix | 2 +- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/flake.nix b/flake.nix index 978b184..931a6ea 100644 --- a/flake.nix +++ b/flake.nix @@ -30,28 +30,41 @@ }; }; + lib = nixpkgs.lib; + + orbekk-modules = + let + moduleFiles = + lib.attrNames ( + lib.filterAttrs + (n: v: lib.hasSuffix ".nix" n && v == "regular") + (builtins.readDir ./modules)); + + moduleNames = map (lib.removeSuffix ".nix") moduleFiles; + + mkModule = name: { + inherit name; + value = import (./. + "/modules/${name}.nix"); + }; + in lib.listToAttrs (map mkModule moduleNames); + in { - nixosModules = [ - pkgs-module - ./modules/common.nix - ./modules/desktop.nix - ./modules/gaming.nix - ./modules/thinkpad.nix - ./modules/users.nix - ./modules/yubikey.nix - ]; + nixosModules = + orbekk-modules // { + inherit pkgs-module; + }; nixosConfigurations = let mkConfig = { hostName , module ? (./. + "/machines/${hostName}.nix") , system ? "x86_64-linux" }: { name = hostName; - value = nixpkgs.lib.nixosSystem { + value = lib.nixosSystem { inherit system; modules = - self.nixosModules ++ + (lib.attrValues self.nixosModules) ++ [ pkgs-module module diff --git a/machines/dragon.nix b/machines/dragon.nix index 63479c9..cded6e7 100644 --- a/machines/dragon.nix +++ b/machines/dragon.nix @@ -8,8 +8,6 @@ in #../config/minecraft.nix ../config/mpd.nix ../config/borg-backup.nix - ../config/common.nix - ../config/users.nix # ../config/weechat.nix ../config/dns.nix # ../config/hydra.nix diff --git a/machines/firelink.nix b/machines/firelink.nix index 9ccaa7c..b04c60b 100644 --- a/machines/firelink.nix +++ b/machines/firelink.nix @@ -7,7 +7,7 @@ let patches = [../patches/xow/0001-Single-controller-patch.patch]; }); my-linuxPackages = - let linuxPkgs = super.my-extras.nixpkgs-unstable.legacyPackages.${pkgs.system}.linuxPackages_latest; + let linuxPkgs = super.unstable.linuxPackages_latest; in linuxPkgs.extend (self: super: { # xpadneo = super.xpadneo.overrideAttrs (o: rec { # version = "master"; @@ -22,13 +22,8 @@ let }; in { - imports = [ - ../config/common.nix - ../config/desktop.nix - ../config/yubikey.nix - ]; - orbekk.gaming.enable = true; + orbekk.desktop.enable = true; environment.systemPackages = with pkgs; [ openmw diff --git a/machines/x1-pincer.nix b/machines/x1-pincer.nix index 35523d6..8c20c59 100644 --- a/machines/x1-pincer.nix +++ b/machines/x1-pincer.nix @@ -3,7 +3,7 @@ let ports = { minecraft = 25565; }; in { - # orbekk.gaming.enable = true; + orbekk.gaming.enable = true; orbekk.desktop.enable = true; orbekk.thinkpad.enable = true; -- cgit v1.2.3