From 8abf744687ea6e0b040d726b177357748e4a7d06 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Sun, 11 Aug 2024 10:34:24 -0400 Subject: [PATCH 1/3] Moved custom services & hardware hacks to nixos root folder --- hosts/hl-minipc1.nix | 2 +- hosts/hl-minipc2.nix | 2 +- modules/main.nix | 3 +-- modules/nixos/common/default.nix | 6 ++++++ modules/{hl-hardware => nixos/common/hardware}/default.nix | 0 modules/{hl-hardware => nixos/common/hardware}/fan2go.nix | 4 ++-- .../{hl-hardware => nixos/common/hardware}/fancontrol.nix | 4 ++-- modules/nixos/default.nix | 7 +++++++ modules/nixos/desktop/default.nix | 1 + modules/{hl-services => nixos/server}/audiobookshelf.nix | 4 ++-- modules/{hl-services => nixos/server}/coral-tpu-udev.nix | 4 ++-- modules/{hl-services => nixos/server}/default.nix | 0 12 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 modules/nixos/common/default.nix rename modules/{hl-hardware => nixos/common/hardware}/default.nix (100%) rename modules/{hl-hardware => nixos/common/hardware}/fan2go.nix (95%) rename modules/{hl-hardware => nixos/common/hardware}/fancontrol.nix (85%) create mode 100644 modules/nixos/default.nix create mode 100644 modules/nixos/desktop/default.nix rename modules/{hl-services => nixos/server}/audiobookshelf.nix (96%) rename modules/{hl-services => nixos/server}/coral-tpu-udev.nix (87%) rename modules/{hl-services => nixos/server}/default.nix (100%) diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1.nix index 30be545..4bc47a5 100644 --- a/hosts/hl-minipc1.nix +++ b/hosts/hl-minipc1.nix @@ -21,7 +21,7 @@ options = [ "nofail" ]; }; # Services - homelab.services.audiobookshelf = { + skg.homelab.services.audiobookshelf = { enable = true; host = "0.0.0.0"; openFirewall = true; diff --git a/hosts/hl-minipc2.nix b/hosts/hl-minipc2.nix index 0a17591..ed20ebf 100644 --- a/hosts/hl-minipc2.nix +++ b/hosts/hl-minipc2.nix @@ -9,7 +9,7 @@ boot.loader.efi.canTouchEfiVariables = true; # Special udev rule for google's coral tpu - homelab.udevrules.coraltpu.enable = true; + skg.homelab.udevrules.coraltpu.enable = true; # Containers virtualisation.oci-containers = { diff --git a/modules/main.nix b/modules/main.nix index cf26f83..15fc0ab 100644 --- a/modules/main.nix +++ b/modules/main.nix @@ -18,8 +18,7 @@ { pkgs, ... }: { imports = [ (import ./skyg) - (import ./hl-services) - (import ./hl-hardware) + (import ./nixos) ] ++ (if desktop.enable then [ (import ./desktop ({ user = user; } // desktop)) ] else diff --git a/modules/nixos/common/default.nix b/modules/nixos/common/default.nix new file mode 100644 index 0000000..1b7d70b --- /dev/null +++ b/modules/nixos/common/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./hardware + ]; +} diff --git a/modules/hl-hardware/default.nix b/modules/nixos/common/hardware/default.nix similarity index 100% rename from modules/hl-hardware/default.nix rename to modules/nixos/common/hardware/default.nix diff --git a/modules/hl-hardware/fan2go.nix b/modules/nixos/common/hardware/fan2go.nix similarity index 95% rename from modules/hl-hardware/fan2go.nix rename to modules/nixos/common/hardware/fan2go.nix index 9964170..57c6d42 100644 --- a/modules/hl-hardware/fan2go.nix +++ b/modules/nixos/common/hardware/fan2go.nix @@ -5,7 +5,7 @@ , ... }: let - cfg = config.homelab.hardware.fan2go; + cfg = config.skyg.hardware.fan2go; fan2goConfig = pkgs.writeText "fan2go.yaml" '' dbPath: ${cfg.dbPath} @@ -65,7 +65,7 @@ let ''; in { - options.homelab.hardware.fan2go = with lib; { + options.skyg.hardware.fan2go = with lib; { enable = mkEnableOption "fan2go"; dbPath = mkOption { diff --git a/modules/hl-hardware/fancontrol.nix b/modules/nixos/common/hardware/fancontrol.nix similarity index 85% rename from modules/hl-hardware/fancontrol.nix rename to modules/nixos/common/hardware/fancontrol.nix index 37b4a24..a3bbe06 100644 --- a/modules/hl-hardware/fancontrol.nix +++ b/modules/nixos/common/hardware/fancontrol.nix @@ -4,10 +4,10 @@ , ... }: let - cfg = config.homelab.hardware.fancontrol; + cfg = config.skyg.hardware.fancontrol; in { - options.homelab.hardware.fancontrol = with lib; { + options.skyg.hardware.fancontrol = with lib; { enable = mkEnableOption "fancontrol"; configName = mkOption { type = types.str; diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..e998ce2 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./common + ./server + ]; +} diff --git a/modules/nixos/desktop/default.nix b/modules/nixos/desktop/default.nix new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/modules/nixos/desktop/default.nix @@ -0,0 +1 @@ + diff --git a/modules/hl-services/audiobookshelf.nix b/modules/nixos/server/audiobookshelf.nix similarity index 96% rename from modules/hl-services/audiobookshelf.nix rename to modules/nixos/server/audiobookshelf.nix index cf9d9e5..755ea60 100644 --- a/modules/hl-services/audiobookshelf.nix +++ b/modules/nixos/server/audiobookshelf.nix @@ -2,10 +2,10 @@ with lib; -let cfg = config.homelab.services.audiobookshelf; +let cfg = config.skyg.homelab.services.audiobookshelf; in { options = { - homelab.services.audiobookshelf = { + skyg.homelab.services.audiobookshelf = { enable = mkEnableOption "Audiobookshelf, self-hosted audiobook and podcast server."; diff --git a/modules/hl-services/coral-tpu-udev.nix b/modules/nixos/server/coral-tpu-udev.nix similarity index 87% rename from modules/hl-services/coral-tpu-udev.nix rename to modules/nixos/server/coral-tpu-udev.nix index 6c32f25..dad16b9 100644 --- a/modules/hl-services/coral-tpu-udev.nix +++ b/modules/nixos/server/coral-tpu-udev.nix @@ -1,9 +1,9 @@ { config, lib, ... }: with lib; -let cfg = config.homelab.udevrules.coraltpu; +let cfg = config.skyg.homelab.udevrules.coraltpu; in { options = { - homelab.udevrules.coraltpu = { + skyg.homelab.udevrules.coraltpu = { enable = mkEnableOption "Enable Coral TPU Udev rules"; symlinkName = mkOption { diff --git a/modules/hl-services/default.nix b/modules/nixos/server/default.nix similarity index 100% rename from modules/hl-services/default.nix rename to modules/nixos/server/default.nix From 51cae968689e7b8249b0e27bfb2f61592f97a17c Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 12 Aug 2024 08:55:10 -0400 Subject: [PATCH 2/3] added slack --- hosts/hl-minipc1.nix | 2 +- hosts/hl-minipc2.nix | 2 +- modules/home/default.nix | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1.nix index 4bc47a5..6c77f62 100644 --- a/hosts/hl-minipc1.nix +++ b/hosts/hl-minipc1.nix @@ -21,7 +21,7 @@ options = [ "nofail" ]; }; # Services - skg.homelab.services.audiobookshelf = { + skyg.homelab.services.audiobookshelf = { enable = true; host = "0.0.0.0"; openFirewall = true; diff --git a/hosts/hl-minipc2.nix b/hosts/hl-minipc2.nix index ed20ebf..87c0533 100644 --- a/hosts/hl-minipc2.nix +++ b/hosts/hl-minipc2.nix @@ -9,7 +9,7 @@ boot.loader.efi.canTouchEfiVariables = true; # Special udev rule for google's coral tpu - skg.homelab.udevrules.coraltpu.enable = true; + skyg.homelab.udevrules.coraltpu.enable = true; # Containers virtualisation.oci-containers = { diff --git a/modules/home/default.nix b/modules/home/default.nix index 365e6b4..a8dc1f8 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -43,6 +43,7 @@ in devbox terraform kubectl + slack ] else [ ]); }; From 115f0e8d341dba6dacf165dad8b9fd7b7d046b52 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 12 Aug 2024 09:14:44 -0400 Subject: [PATCH 3/3] Removed lix & rofi-bw --- flake.lock | 86 +------------------------------------ flake.nix | 7 --- hosts/fwbook.nix | 9 ++++ modules/desktop/default.nix | 37 ---------------- modules/home/default.nix | 32 ++++++++++++++ modules/lib.nix | 2 - 6 files changed, 42 insertions(+), 131 deletions(-) diff --git a/flake.lock b/flake.lock index 636c1b0..c1dab89 100644 --- a/flake.lock +++ b/flake.lock @@ -1,38 +1,5 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flakey-profile": { - "locked": { - "lastModified": 1712898590, - "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", - "owner": "lf-", - "repo": "flakey-profile", - "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", - "type": "github" - }, - "original": { - "owner": "lf-", - "repo": "flakey-profile", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -54,41 +21,6 @@ "type": "github" } }, - "lix": { - "flake": false, - "locked": { - "lastModified": 1720626042, - "narHash": "sha256-f8k+BezKdJfmE+k7zgBJiohtS3VkkriycdXYsKOm3sc=", - "rev": "2a4376be20d70feaa2b0e640c5041fb66ddc67ed", - "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2a4376be20d70feaa2b0e640c5041fb66ddc67ed.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://git.lix.systems/lix-project/lix/archive/2.90.0.tar.gz" - } - }, - "lix-module": { - "inputs": { - "flake-utils": "flake-utils", - "flakey-profile": "flakey-profile", - "lix": "lix", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1720641669, - "narHash": "sha256-yEO2cGNgzm9x/XxiDQI+WckSWnZX63R8aJLBRSXtYNE=", - "rev": "5c48c833c15bb80d127a398a8c2484d42fdd8257", - "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/5c48c833c15bb80d127a398a8c2484d42fdd8257.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz" - } - }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -144,11 +76,10 @@ "root": { "inputs": { "home-manager": "home-manager", - "lix-module": "lix-module", "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", - "systems": "systems_2", + "systems": "systems", "unstable": "unstable", "unstable-home-manager": "unstable-home-manager" } @@ -168,21 +99,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "unstable": { "locked": { "lastModified": 1722630782, diff --git a/flake.nix b/flake.nix index 05fe2e9..23700d5 100644 --- a/flake.nix +++ b/flake.nix @@ -6,11 +6,6 @@ # Nixpkgs unstable.url = "github:NixOS/nixpkgs/master"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; - # Lix - lix-module = { - url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz"; - inputs.nixpkgs.follows = "nixpkgs"; - }; # Home manager home-manager = { url = "github:nix-community/home-manager/release-24.05"; @@ -33,7 +28,6 @@ , nixpkgs , systems , unstable - , lix-module , home-manager , unstable-home-manager , nix-darwin @@ -83,7 +77,6 @@ # Lib Config libConfig = { nix-darwin = nix-darwin; - lix-module = lix-module; hlCommonSettings = hlCommonSettings; systems = systems; }; diff --git a/hosts/fwbook.nix b/hosts/fwbook.nix index 43f1252..bc79e88 100644 --- a/hosts/fwbook.nix +++ b/hosts/fwbook.nix @@ -34,7 +34,16 @@ in amdctl # python python312 + # crypto + trezor-suite + trezord + ledger-live-desktop ]; + # udev rules for crypto wallets + services.udev.packages = with pkgs; [ ledger-udev-rules trezor-udev-rules ]; + # trezor groups + users.groups.trezord = { }; + users.groups.trezord.members = [ user.name ]; # # Opengl hardware.opengl = { driSupport = true; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 97b1e31..1924fb9 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -20,41 +20,4 @@ # Mobile Connect programs.kdeconnect.enable = true; # Web - # Personal Desktop App - users.users.${user.name}.packages = with pkgs; [ - # web - brave - # mail - thunderbird - # password - bitwarden-desktop - rofi-rbw-wayland - rofi-rbw-x11 - # development - vscode - # socials - zoom-us - betterdiscordctl - discord - signal-desktop - whatsapp-for-linux - caprine-bin # facebook messenger - # crypto - trezor-suite - trezord - ledger-live-desktop - # documents - onlyoffice-bin_latest - # video - vlc - vlc-bittorrent - # terminal - alacritty - alacritty-theme - ]; - # udev rules for crypto wallets - services.udev.packages = with pkgs; [ ledger-udev-rules trezor-udev-rules ]; - # trezor groups - users.groups.trezord = { }; - users.groups.trezord.members = [ user.name ]; } diff --git a/modules/home/default.nix b/modules/home/default.nix index a8dc1f8..c1b6f47 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -43,7 +43,39 @@ in devbox terraform kubectl + + # socials slack + zoom-us + betterdiscordctl + discord + signal-desktop + whatsapp-for-linux + caprine-bin # facebook messenger + + # development + vscode + + # web + brave + + # mail + thunderbird + + # password + bitwarden-desktop + + # documents + onlyoffice-bin_latest + + # video + vlc + vlc-bittorrent + + # terminal + alacritty + alacritty-theme + ] else [ ]); }; diff --git a/modules/lib.nix b/modules/lib.nix index d304376..0cdaeb2 100644 --- a/modules/lib.nix +++ b/modules/lib.nix @@ -1,7 +1,6 @@ { nixpkgs , home-manager , nix-darwin -, lix-module , systems , hlCommonSettings }: @@ -33,7 +32,6 @@ let attrs = joinedttrs; extraConfiguration = [ home-manager.nixosModules.default - lix-module.nixosModules.default ]; }); };