diff --git a/.git-age.yaml b/.git-age.yaml index 0219812..acdb861 100644 --- a/.git-age.yaml +++ b/.git-age.yaml @@ -1,2 +1,2 @@ -"apps/firefox/work.nix": +"apps/gui/firefox/work.nix": - age105cm5awxxegyrqthh4vhnxzr0tdy86q8uq52wkkjacfkutp2vprqwseak7 diff --git a/.gitattributes b/.gitattributes index ba29335..69d4ba9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -apps/firefox/work.nix filter=git-age diff=git-age +apps/gui/firefox/work.nix filter=git-age diff=git-age diff --git a/apps/firefox/work.nix b/apps/firefox/work.nix deleted file mode 100644 index 7e20945..0000000 Binary files a/apps/firefox/work.nix and /dev/null differ diff --git a/apps/default.nix b/apps/gui/default.nix similarity index 81% rename from apps/default.nix rename to apps/gui/default.nix index 08c7d47..1550be5 100644 --- a/apps/default.nix +++ b/apps/gui/default.nix @@ -1,9 +1,7 @@ {pkgs, ...}: { imports = [ - ./common.nix - + ../nogui ./firefox.nix - ./go.nix ./gtk.nix ./spotifyd.nix ./tiny.nix @@ -18,23 +16,21 @@ spotify-tui # LSPs - gopls lua-language-server marksman nodePackages.yaml-language-server # Formatters - alejandra + nodePackages.lua-fmt + python3Packages.black # IDEs jetbrains.goland # Personal NUR - nur.repos.jolheiser.git-age nur.repos.jolheiser.gomodinit nur.repos.jolheiser.imp nur.repos.jolheiser.kv - nur.repos.jolheiser.tclip nur.repos.jolheiser.tmpl ]; }; diff --git a/apps/firefox.nix b/apps/gui/firefox.nix similarity index 100% rename from apps/firefox.nix rename to apps/gui/firefox.nix diff --git a/apps/gui/firefox/work.nix b/apps/gui/firefox/work.nix new file mode 100644 index 0000000..ef67b24 Binary files /dev/null and b/apps/gui/firefox/work.nix differ diff --git a/apps/gtk.nix b/apps/gui/gtk.nix similarity index 100% rename from apps/gtk.nix rename to apps/gui/gtk.nix diff --git a/apps/spotifyd.nix b/apps/gui/spotifyd.nix similarity index 100% rename from apps/spotifyd.nix rename to apps/gui/spotifyd.nix diff --git a/apps/tiny.nix b/apps/gui/tiny.nix similarity index 100% rename from apps/tiny.nix rename to apps/gui/tiny.nix diff --git a/apps/wezterm.nix b/apps/gui/wezterm.nix similarity index 100% rename from apps/wezterm.nix rename to apps/gui/wezterm.nix diff --git a/apps/wezterm/wezterm.lua b/apps/gui/wezterm/wezterm.lua similarity index 100% rename from apps/wezterm/wezterm.lua rename to apps/gui/wezterm/wezterm.lua diff --git a/apps/bat.nix b/apps/nogui/bat.nix similarity index 100% rename from apps/bat.nix rename to apps/nogui/bat.nix diff --git a/apps/bottom.nix b/apps/nogui/bottom.nix similarity index 100% rename from apps/bottom.nix rename to apps/nogui/bottom.nix diff --git a/apps/common.nix b/apps/nogui/default.nix similarity index 83% rename from apps/common.nix rename to apps/nogui/default.nix index aa971bd..0de7a0d 100644 --- a/apps/common.nix +++ b/apps/nogui/default.nix @@ -8,8 +8,9 @@ ./bottom.nix ./exa.nix ./fzf.nix - ./gpg.nix ./git.nix + ./go.nix + ./gpg.nix ./helix.nix ./jq.nix ./lazygit.nix @@ -29,12 +30,19 @@ fd just ripgrep + usql # LSPs + gopls nil # Formatters alejandra + gofumpt + + # Personal NUR + nur.repos.jolheiser.git-age + nur.repos.jolheiser.tclip ]; activation.report-changes = config.lib.dag.entryAnywhere '' ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff $oldGenPath $newGenPath diff --git a/apps/exa.nix b/apps/nogui/exa.nix similarity index 100% rename from apps/exa.nix rename to apps/nogui/exa.nix diff --git a/apps/fzf.nix b/apps/nogui/fzf.nix similarity index 100% rename from apps/fzf.nix rename to apps/nogui/fzf.nix diff --git a/apps/git.nix b/apps/nogui/git.nix similarity index 100% rename from apps/git.nix rename to apps/nogui/git.nix diff --git a/apps/go.nix b/apps/nogui/go.nix similarity index 100% rename from apps/go.nix rename to apps/nogui/go.nix diff --git a/apps/gpg.nix b/apps/nogui/gpg.nix similarity index 100% rename from apps/gpg.nix rename to apps/nogui/gpg.nix diff --git a/apps/helix.nix b/apps/nogui/helix.nix similarity index 100% rename from apps/helix.nix rename to apps/nogui/helix.nix diff --git a/apps/jq.nix b/apps/nogui/jq.nix similarity index 100% rename from apps/jq.nix rename to apps/nogui/jq.nix diff --git a/apps/lazygit.nix b/apps/nogui/lazygit.nix similarity index 100% rename from apps/lazygit.nix rename to apps/nogui/lazygit.nix diff --git a/apps/nushell.nix b/apps/nogui/nushell.nix similarity index 100% rename from apps/nushell.nix rename to apps/nogui/nushell.nix diff --git a/apps/nushell/config.nu b/apps/nogui/nushell/config.nu similarity index 100% rename from apps/nushell/config.nu rename to apps/nogui/nushell/config.nu diff --git a/apps/nushell/env.nu b/apps/nogui/nushell/env.nu similarity index 100% rename from apps/nushell/env.nu rename to apps/nogui/nushell/env.nu diff --git a/apps/nushell/jolheiser.nu b/apps/nogui/nushell/jolheiser.nu similarity index 100% rename from apps/nushell/jolheiser.nu rename to apps/nogui/nushell/jolheiser.nu diff --git a/apps/nushell/ohmyposh.nu b/apps/nogui/nushell/ohmyposh.nu similarity index 100% rename from apps/nushell/ohmyposh.nu rename to apps/nogui/nushell/ohmyposh.nu diff --git a/apps/nushell/zoxide.nu b/apps/nogui/nushell/zoxide.nu similarity index 100% rename from apps/nushell/zoxide.nu rename to apps/nogui/nushell/zoxide.nu diff --git a/apps/oh-my-posh.nix b/apps/nogui/oh-my-posh.nix similarity index 100% rename from apps/oh-my-posh.nix rename to apps/nogui/oh-my-posh.nix diff --git a/apps/ohmyposh/config.json b/apps/nogui/ohmyposh/config.json similarity index 100% rename from apps/ohmyposh/config.json rename to apps/nogui/ohmyposh/config.json diff --git a/apps/ssh.nix b/apps/nogui/ssh.nix similarity index 100% rename from apps/ssh.nix rename to apps/nogui/ssh.nix diff --git a/apps/xdg.nix b/apps/nogui/xdg.nix similarity index 100% rename from apps/xdg.nix rename to apps/nogui/xdg.nix diff --git a/apps/zoxide.nix b/apps/nogui/zoxide.nix similarity index 100% rename from apps/zoxide.nix rename to apps/nogui/zoxide.nix diff --git a/flake.nix b/flake.nix index 8d631b9..07a543e 100644 --- a/flake.nix +++ b/flake.nix @@ -36,7 +36,7 @@ }; }; }; - commonConfig = {server ? false}: { + commonConfig = {gui ? true}: { config, pkgs, ... @@ -46,33 +46,26 @@ owner = username; }; in { - config = - { - nixpkgs.overlays = [overlays]; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.${username}.imports = - if !server - then [./apps] - else [./apps/common.nix]; - extraSpecialArgs = { - flakePath = "/home/${username}/.config/nixpkgs"; - }; + config = { + nixpkgs.overlays = [overlays]; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.${username}.imports = + if gui + then [./apps/gui] + else [./apps/nogui]; + extraSpecialArgs = { + flakePath = "/home/${username}/.config/nixpkgs"; }; - } - // ( - if !server - then { - age.secrets = { - ssh-config = userSecret ./secrets/shared/ssh-config.age; - ssh-config-work = userSecret ./secrets/shared/ssh-config-work.age; - spotify-pw = userSecret ./secrets/shared/spotify-pw.age; - irc-pw = userSecret ./secrets/shared/irc-pw.age; - }; - } - else {} - ); + }; + age.secrets = { + ssh-config = userSecret ./secrets/shared/ssh-config.age; + ssh-config-work = userSecret ./secrets/shared/ssh-config-work.age; + spotify-pw = userSecret ./secrets/shared/spotify-pw.age; + irc-pw = userSecret ./secrets/shared/irc-pw.age; + }; + }; }; username = "jolheiser"; in @@ -83,9 +76,8 @@ modules = [ home-manager.nixosModules.home-manager agenix.nixosModules.default - ./machines/common ./machines/chai - commonConfig + (commonConfig {}) ({pkgs, ...}: { config = { nixpkgs.overlays = [ @@ -95,7 +87,7 @@ ]; home-manager.users.${username}.programs = { git.package = pkgs.gitSVN; - firefox.profiles.default.bookmarks = [(import ./apps/firefox/work.nix)]; + firefox.profiles.default.bookmarks = [(import ./apps/gui/firefox/work.nix)]; }; age.secrets = { netrc = { @@ -118,17 +110,17 @@ modules = [ home-manager.nixosModules.home-manager agenix.nixosModules.default - ./machines/common ./machines/matcha - commonConfig + (commonConfig {}) ]; }; "dragonwell" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager + agenix.nixosModules.default ./machines/dragonwell - (commonConfig {server = true;}) + (commonConfig {gui = false;}) ]; }; }; diff --git a/machines/chai/default.nix b/machines/chai/default.nix index ccbd57a..837f4b9 100644 --- a/machines/chai/default.nix +++ b/machines/chai/default.nix @@ -1,7 +1,7 @@ {pkgs, ...}: let username = "jolheiser"; in { - imports = [./hardware.nix ../common]; + imports = [./hardware.nix ../common/gui]; boot = { kernelPackages = pkgs.linuxPackages_latest; diff --git a/machines/common/sound.nix b/machines/common/gui/default.nix similarity index 50% rename from machines/common/sound.nix rename to machines/common/gui/default.nix index aa63060..c09fe13 100644 --- a/machines/common/sound.nix +++ b/machines/common/gui/default.nix @@ -1,4 +1,6 @@ -{ +{pkgs, ...}: { + imports = [../nogui]; + sound.enable = true; hardware.pulseaudio.enable = false; security = {rtkit.enable = true;}; @@ -9,4 +11,12 @@ alsa.enable = true; }; }; + + services.xserver = { + enable = true; + displayManager.lightdm.enable = true; + desktopManager.cinnamon.enable = true; + layout = "us"; + xkbVariant = ""; + }; } diff --git a/machines/common/default.nix b/machines/common/nogui/default.nix similarity index 96% rename from machines/common/default.nix rename to machines/common/nogui/default.nix index 7aadb45..e08ef1b 100644 --- a/machines/common/default.nix +++ b/machines/common/nogui/default.nix @@ -1,6 +1,4 @@ {pkgs, ...}: { - imports = [./sound.nix ./xserver.nix]; - console.colors = [ "1e1e2e" "585b70" diff --git a/machines/common/xserver.nix b/machines/common/xserver.nix deleted file mode 100644 index de0d030..0000000 --- a/machines/common/xserver.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: { - services.xserver = { - enable = true; - displayManager.lightdm.enable = true; - desktopManager.cinnamon.enable = true; - layout = "us"; - xkbVariant = ""; - }; -} diff --git a/machines/dragonwell/default.nix b/machines/dragonwell/default.nix index 589e707..c35fef6 100644 --- a/machines/dragonwell/default.nix +++ b/machines/dragonwell/default.nix @@ -1,26 +1,7 @@ {pkgs, ...}: let username = "jolheiser"; in { - imports = [./hardware.nix]; - - nixpkgs.config.allowUnfree = true; - - nix = { - gc.automatic = true; - package = pkgs.nixVersions.nix_2_15; - settings = { - experimental-features = ["flakes" "nix-command" "repl-flake"]; - auto-optimise-store = true; - warn-dirty = false; - }; - }; - - system.activationScripts.diff = { - supportsDryActivation = true; - text = '' - ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" - ''; - }; + imports = [./hardware.nix ../common/nogui]; boot.tmp.cleanOnBoot = true; zramSwap.enable = true; @@ -32,10 +13,7 @@ in { }; services = { - openssh = { - enable = true; - }; - + openssh.enable = true; tailscale.enable = true; }; diff --git a/machines/matcha/default.nix b/machines/matcha/default.nix index 149312d..a73bd31 100644 --- a/machines/matcha/default.nix +++ b/machines/matcha/default.nix @@ -1,7 +1,7 @@ {pkgs, ...}: let username = "jolheiser"; in { - imports = [./hardware.nix ../common]; + imports = [./hardware.nix ../common/gui]; boot = { kernelPackages = pkgs.linuxPackages_latest;