diff --git a/.git-age.yaml b/.git-age.yaml index acdb86124b6d79173ccd1fbbcd6fe0156f6d19fe..0219812864cff938ae08a246e2a683f1c56cae81 100644 --- a/.git-age.yaml +++ b/.git-age.yaml @@ -1,2 +1,2 @@ -"apps/gui/firefox/work.nix": +"apps/firefox/work.nix": - age105cm5awxxegyrqthh4vhnxzr0tdy86q8uq52wkkjacfkutp2vprqwseak7 diff --git a/.gitattributes b/.gitattributes index 69d4ba9adf5831402078da784f6af9334921bf4a..ba293352689fb044936874aaaf18855645c43501 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -apps/gui/firefox/work.nix filter=git-age diff=git-age +apps/firefox/work.nix filter=git-age diff=git-age diff --git a/apps/firefox/work.nix b/apps/firefox/work.nix new file mode 100644 index 0000000000000000000000000000000000000000..7e20945db2e3d418b38f9fdd874574b8f3ec2e07 Binary files /dev/null and b/apps/firefox/work.nix differ diff --git a/apps/gui/default.nix b/apps/default.nix rename from apps/gui/default.nix rename to apps/default.nix index 1550be57386ddaee404665cc28691ee8a4c528a3..08c7d47fd76bd9ef409eb7af9ee5002503f403b0 100644 --- a/apps/gui/default.nix +++ b/apps/default.nix @@ -1,7 +1,10 @@ {pkgs, ...}: { imports = [ ../nogui + ./gtk.nix + ./firefox.nix + ./go.nix ./gtk.nix ./spotifyd.nix ./tiny.nix @@ -16,22 +19,24 @@ obsidian spotify-tui # LSPs + gopls lua-language-server marksman nodePackages.yaml-language-server # Formatters - imports = [ ../nogui - python3Packages.black + ./wezterm.nix # IDEs jetbrains.goland # Personal NUR + nur.repos.jolheiser.git-age nur.repos.jolheiser.gomodinit nur.repos.jolheiser.imp ../nogui + ./firefox.nix nur.repos.jolheiser.tmpl ]; }; diff --git a/apps/gui/firefox.nix b/apps/firefox.nix rename from apps/gui/firefox.nix rename to apps/firefox.nix diff --git a/apps/gui/firefox/work.nix b/apps/gui/firefox/work.nix deleted file mode 100644 index ef67b2449129b4a23087bf84314ff8914acc4b2d..0000000000000000000000000000000000000000 Binary files a/apps/gui/firefox/work.nix and /dev/null differ diff --git a/apps/gui/gtk.nix b/apps/gtk.nix rename from apps/gui/gtk.nix rename to apps/gtk.nix diff --git a/apps/gui/spotifyd.nix b/apps/spotifyd.nix rename from apps/gui/spotifyd.nix rename to apps/spotifyd.nix diff --git a/apps/gui/tiny.nix b/apps/tiny.nix rename from apps/gui/tiny.nix rename to apps/tiny.nix diff --git a/apps/gui/wezterm.nix b/apps/wezterm.nix rename from apps/gui/wezterm.nix rename to apps/wezterm.nix diff --git a/apps/gui/wezterm/wezterm.lua b/apps/wezterm/wezterm.lua rename from apps/gui/wezterm/wezterm.lua rename to apps/wezterm/wezterm.lua diff --git a/apps/nogui/bat.nix b/apps/bat.nix rename from apps/nogui/bat.nix rename to apps/bat.nix diff --git a/apps/nogui/bottom.nix b/apps/bottom.nix rename from apps/nogui/bottom.nix rename to apps/bottom.nix diff --git a/apps/nogui/default.nix b/apps/common.nix rename from apps/nogui/default.nix rename to apps/common.nix index 0de7a0dcc34b5757fb4828456fa4d7aefc744617..aa971bd3d1b83547455fd326f6a86442f94a03c5 100644 --- a/apps/nogui/default.nix +++ b/apps/common.nix @@ -9,11 +9,9 @@ ./bottom.nix ./exa.nix ./fzf.nix { -{ + config, { - pkgs, { - config, ./helix.nix ./jq.nix ./lazygit.nix @@ -34,20 +32,12 @@ fd just ripgrep config, - config, - config, ... # 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/nogui/exa.nix b/apps/exa.nix rename from apps/nogui/exa.nix rename to apps/exa.nix diff --git a/apps/nogui/fzf.nix b/apps/fzf.nix rename from apps/nogui/fzf.nix rename to apps/fzf.nix diff --git a/apps/nogui/git.nix b/apps/git.nix rename from apps/nogui/git.nix rename to apps/git.nix diff --git a/apps/nogui/go.nix b/apps/go.nix rename from apps/nogui/go.nix rename to apps/go.nix diff --git a/apps/nogui/gpg.nix b/apps/gpg.nix rename from apps/nogui/gpg.nix rename to apps/gpg.nix diff --git a/apps/nogui/helix.nix b/apps/helix.nix rename from apps/nogui/helix.nix rename to apps/helix.nix diff --git a/apps/nogui/jq.nix b/apps/jq.nix rename from apps/nogui/jq.nix rename to apps/jq.nix diff --git a/apps/nogui/lazygit.nix b/apps/lazygit.nix rename from apps/nogui/lazygit.nix rename to apps/lazygit.nix diff --git a/apps/nogui/nushell.nix b/apps/nushell.nix rename from apps/nogui/nushell.nix rename to apps/nushell.nix diff --git a/apps/nogui/nushell/config.nu b/apps/nushell/config.nu rename from apps/nogui/nushell/config.nu rename to apps/nushell/config.nu diff --git a/apps/nogui/nushell/env.nu b/apps/nushell/env.nu rename from apps/nogui/nushell/env.nu rename to apps/nushell/env.nu diff --git a/apps/nogui/nushell/jolheiser.nu b/apps/nushell/jolheiser.nu rename from apps/nogui/nushell/jolheiser.nu rename to apps/nushell/jolheiser.nu diff --git a/apps/nogui/nushell/ohmyposh.nu b/apps/nushell/ohmyposh.nu rename from apps/nogui/nushell/ohmyposh.nu rename to apps/nushell/ohmyposh.nu diff --git a/apps/nogui/nushell/zoxide.nu b/apps/nushell/zoxide.nu rename from apps/nogui/nushell/zoxide.nu rename to apps/nushell/zoxide.nu diff --git a/apps/nogui/oh-my-posh.nix b/apps/oh-my-posh.nix rename from apps/nogui/oh-my-posh.nix rename to apps/oh-my-posh.nix diff --git a/apps/nogui/ohmyposh/config.json b/apps/ohmyposh/config.json rename from apps/nogui/ohmyposh/config.json rename to apps/ohmyposh/config.json diff --git a/apps/nogui/ssh.nix b/apps/ssh.nix rename from apps/nogui/ssh.nix rename to apps/ssh.nix diff --git a/apps/nogui/xdg.nix b/apps/xdg.nix rename from apps/nogui/xdg.nix rename to apps/xdg.nix diff --git a/apps/nogui/zoxide.nix b/apps/zoxide.nix rename from apps/nogui/zoxide.nix rename to apps/zoxide.nix diff --git a/flake.nix b/flake.nix index 07a543e0c464c8499f3f3f68ebd43e941a0d670d..8d631b9b473de2ef9a330bdeedaa3be3e762487a 100644 --- a/flake.nix +++ b/flake.nix @@ -36,7 +36,7 @@ jolheiser = import jolheiser-nur {pkgs = prev;}; }; }; }; - commonConfig = {gui ? true}: { + commonConfig = {server ? false}: { config, pkgs, ... @@ -46,40 +46,53 @@ file = path; owner = username; }; in { - config = { + config = + { + nixpkgs.overlays = [overlays]; + home-manager = { + darwin.follows = ""; inputs = { + darwin.follows = ""; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - inputs = { + darwin.follows = ""; home-manager.url = "github:nix-community/home-manager"; - inputs = { + darwin.follows = ""; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - inputs = { + darwin.follows = ""; agenix.url = "github:ryantm/agenix"; - inputs = { + darwin.follows = ""; agenix.inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; description = "jolheiser's nixos config"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - }; - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; home-manager.url = "github:nix-community/home-manager"; - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; agenix.url = "github:ryantm/agenix"; - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + }; agenix.inputs = { - home-manager.url = "github:nix-community/home-manager"; + flake-utils.url = "github:numtide/flake-utils"; +{ +{ + }; +{ + description = "jolheiser's nixos config"; + else {} +{ }; }; username = "jolheiser"; @@ -91,9 +104,10 @@ system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager agenix.nixosModules.default + ./machines/common ./machines/chai - home-manager.inputs.nixpkgs.follows = "nixpkgs"; { + config, ({pkgs, ...}: { config = { nixpkgs.overlays = [ @@ -103,8 +117,8 @@ }) ]; home-manager.users.${username}.programs = { git.package = pkgs.gitSVN; - agenix.url = "github:ryantm/agenix"; { + pkgs, }; age.secrets = { netrc = { @@ -127,18 +141,18 @@ system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager agenix.nixosModules.default + ./machines/common ./machines/matcha - home-manager.inputs.nixpkgs.follows = "nixpkgs"; { + config, ]; }; "dragonwell" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ home-manager.nixosModules.home-manager - agenix.nixosModules.default ./machines/dragonwell - (commonConfig {gui = false;}) + (commonConfig {server = true;}) ]; }; }; diff --git a/machines/chai/default.nix b/machines/chai/default.nix index 837f4b9927b6641e54f7c63029248b5e0e2f6f29..ccbd57aab21902d38a392c210c9ac2a1bf1b4899 100644 --- a/machines/chai/default.nix +++ b/machines/chai/default.nix @@ -1,7 +1,7 @@ {pkgs, ...}: let username = "jolheiser"; in { - imports = [./hardware.nix ../common/gui]; + imports = [./hardware.nix ../common]; boot = { kernelPackages = pkgs.linuxPackages_latest; diff --git a/machines/common/gui/default.nix b/machines/common/gui/default.nix deleted file mode 100644 index c09fe135c526add2a0d347d143976bab5a32fa49..0000000000000000000000000000000000000000 --- a/machines/common/gui/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{pkgs, ...}: { - imports = [../nogui]; - - sound.enable = true; - hardware.pulseaudio.enable = false; - security = {rtkit.enable = true;}; - services = { - pipewire = { - enable = true; - pulse.enable = true; - alsa.enable = true; - }; - }; - - services.xserver = { - enable = true; - displayManager.lightdm.enable = true; - desktopManager.cinnamon.enable = true; - layout = "us"; - xkbVariant = ""; - }; -} diff --git a/machines/common/nogui/default.nix b/machines/common/default.nix rename from machines/common/nogui/default.nix rename to machines/common/default.nix index e08ef1b2c6efadb24d55665ca20ad60af0c88cc9..7aadb458b7ed3252f22bd5e07a3cd13827dc91eb 100644 --- a/machines/common/nogui/default.nix +++ b/machines/common/default.nix @@ -1,4 +1,6 @@ {pkgs, ...}: { + imports = [./sound.nix ./xserver.nix]; + console.colors = [ "1e1e2e" "585b70" diff --git a/machines/common/sound.nix b/machines/common/sound.nix new file mode 100644 index 0000000000000000000000000000000000000000..aa630608409417081dca06ed78155f14c27a9ea0 --- /dev/null +++ b/machines/common/sound.nix @@ -0,0 +1,12 @@ +{ + sound.enable = true; + hardware.pulseaudio.enable = false; + security = {rtkit.enable = true;}; + services = { + pipewire = { + enable = true; + pulse.enable = true; + alsa.enable = true; + }; + }; +} diff --git a/machines/common/xserver.nix b/machines/common/xserver.nix new file mode 100644 index 0000000000000000000000000000000000000000..de0d030d95a15afc1506b4497b1462bcb958d903 --- /dev/null +++ b/machines/common/xserver.nix @@ -0,0 +1,9 @@ +{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 c35fef6c1cbc43d44411ff1943b68602a1d11e0b..589e707bc4db59f6690d203d6987a0f41a607960 100644 --- a/machines/dragonwell/default.nix +++ b/machines/dragonwell/default.nix @@ -1,8 +1,28 @@ {pkgs, ...}: let username = "jolheiser"; in { + username = "jolheiser"; imports = [./hardware.nix ../common/nogui]; + 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" + ''; + }; + boot.tmp.cleanOnBoot = true; zramSwap.enable = true; @@ -13,8 +33,11 @@ firewall.enable = true; }; services = { -{pkgs, ...}: let in { + hostName = "dragonwell"; + enable = true; + }; + tailscale.enable = true; }; diff --git a/machines/matcha/default.nix b/machines/matcha/default.nix index a73bd3145c627b28735541da363e9a0d485de37a..149312deaded55ab88a002392837d5af1859fac9 100644 --- a/machines/matcha/default.nix +++ b/machines/matcha/default.nix @@ -1,7 +1,7 @@ {pkgs, ...}: let username = "jolheiser"; in { - imports = [./hardware.nix ../common/gui]; + imports = [./hardware.nix ../common]; boot = { kernelPackages = pkgs.linuxPackages_latest;