diff --git a/.gitignore b/.gitignore index 334079b..b987ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ mullvad/inactive result *.key *.pub_key -hosts/ +hosts/reflector diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ec57d20..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "rhizome-vps"] - path = rhizome-vps - url = https://git.rhizome.tf/rhizome/server-config diff --git a/TODO b/TODO deleted file mode 100644 index abc7c3a..0000000 --- a/TODO +++ /dev/null @@ -1,7 +0,0 @@ -REPLACE HOME MANAGER WITH -pkgs.writers and HJEM - -implement agenix - -figure out a way to get firefox policies and plugins set up in webapps - diff --git a/home/icons/fb_msg.png b/assets/fb_msg.png similarity index 100% rename from home/icons/fb_msg.png rename to assets/fb_msg.png diff --git a/home/icons/ms_teams.png b/assets/ms_teams.png similarity index 100% rename from home/icons/ms_teams.png rename to assets/ms_teams.png diff --git a/home/icons/ollama.png b/assets/ollama.png similarity index 100% rename from home/icons/ollama.png rename to assets/ollama.png diff --git a/home/icons/openwebui.png b/assets/openwebui.png similarity index 100% rename from home/icons/openwebui.png rename to assets/openwebui.png diff --git a/home/icons/winlogo.png b/assets/winlogo.png similarity index 100% rename from home/icons/winlogo.png rename to assets/winlogo.png diff --git a/base/cli.nix b/base/cli.nix new file mode 100644 index 0000000..9782eab --- /dev/null +++ b/base/cli.nix @@ -0,0 +1,25 @@ +{ + pkgs, + ... +}: +{ + environment.systemPackages = builtins.attrValues { + inherit (pkgs) + curl + eza + git + ; + }; + hm.home.packages = builtins.attrValues { + inherit (pkgs) + btop + bat + ripgrep + fd + lazygit + zoxide + zellij + ouch + ; + }; +} diff --git a/base/debloat.nix b/base/debloat.nix new file mode 100644 index 0000000..64e9788 --- /dev/null +++ b/base/debloat.nix @@ -0,0 +1,13 @@ +{ lib, ... }: +{ + + # misc perl + system.disableInstallerTools = true; + programs.less.lessopen = null; + programs.command-not-found.enable = false; + boot.enableContainers = false; + boot.loader.grub.enable = false; + environment.defaultPackages = lib.mkDefault [ ]; + documentation.info.enable = false; + system.tools.nixos-option.enable = false; +} diff --git a/system/modules/docs.nix b/base/docs.nix similarity index 100% rename from system/modules/docs.nix rename to base/docs.nix diff --git a/home/programs/helix.nix b/base/helix.nix similarity index 99% rename from home/programs/helix.nix rename to base/helix.nix index f6d1f3f..8015c0a 100644 --- a/home/programs/helix.nix +++ b/base/helix.nix @@ -8,7 +8,7 @@ let pal = rice.palette.hex; in { - programs.helix = { + hm.programs.helix = { enable = true; package = inputs.helix.packages.${pkgs.system}.helix; themes = with pal; { diff --git a/base/network.nix b/base/network.nix new file mode 100644 index 0000000..9bdb40e --- /dev/null +++ b/base/network.nix @@ -0,0 +1,4 @@ +{ lib, ... }: +{ + networking.useDHCP = lib.mkDefault true; +} diff --git a/base/nix/gc.nix b/base/nix/gc.nix new file mode 100644 index 0000000..9d36665 --- /dev/null +++ b/base/nix/gc.nix @@ -0,0 +1,27 @@ +{ pkgs, inputs, ... }: +{ + imports = [ + inputs.angrr.nixosModules.angrr + ]; + + nix.gc = { + automatic = true; + dates = "weekly"; + persistent = true; + options = "--delete-older-than 14d"; + }; + + hm.nix.gc = { + automatic = true; + frequency = "weekly"; + options = "--delete-older-than 14d"; + }; + + services.angrr = { + enable = true; + enableNixGcIntegration = true; + period = "2weeks"; + package = inputs.angrr.packages.${pkgs.system}.default; + }; + +} diff --git a/base/nix/managers.nix b/base/nix/managers.nix new file mode 100644 index 0000000..c42886a --- /dev/null +++ b/base/nix/managers.nix @@ -0,0 +1,19 @@ +{ mainUser, ... }: +{ + programs.meat = { + enable = true; + flake = "/home/${mainUser}/.nix"; + }; + + # services.smooooth = { + # enable = true; + # path = "/home/${mainUser}/.nix"; + # blockers = [ + # "hx" + # { + # nix = "die"; + # } + # ]; + # nixPackage = pkgs.lix; + # }; +} diff --git a/base/nix/meat.nix b/base/nix/meat.nix new file mode 100644 index 0000000..4be7fdf --- /dev/null +++ b/base/nix/meat.nix @@ -0,0 +1,10 @@ +{ inputs, mainUser, ... }: +{ + imports = [ + inputs.meat.nixosModules.meat + ]; + programs.meat = { + enable = true; + flake = "/home/${mainUser}/.nix"; + }; +} diff --git a/base/nix/nixpkgs.nix b/base/nix/nixpkgs.nix new file mode 100644 index 0000000..a68d4ac --- /dev/null +++ b/base/nix/nixpkgs.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + }; + }; +} diff --git a/base/nix/settings.nix b/base/nix/settings.nix new file mode 100644 index 0000000..a436d62 --- /dev/null +++ b/base/nix/settings.nix @@ -0,0 +1,26 @@ +{ inputs, ... }: +{ + imports = [ + inputs.lix-module.nixosModules.default + ]; + + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + "pipe-operator" + ]; + substitute = true; + }; + extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + optimise.automatic = true; + }; + + system.nixos.tags = [ "fatcock-xxl" ]; + + home-manager.useGlobalPkgs = true; +} diff --git a/system/substituters.nix b/base/nix/substituters.nix similarity index 100% rename from system/substituters.nix rename to base/nix/substituters.nix diff --git a/base/nix/tools.nix b/base/nix/tools.nix new file mode 100644 index 0000000..e809dce --- /dev/null +++ b/base/nix/tools.nix @@ -0,0 +1,21 @@ +{ pkgs, inputs, ... }: +{ + + environment.systemPackages = builtins.attrValues { + inherit (pkgs) + home-manager + cachix + nixfmt-rfc-style + ; + inherit (inputs.nil.packages.${pkgs.system}) nil; + }; + hm.imports = [ + inputs.nix-index-database.hmModules.nix-index + ]; + imports = [ + inputs.nix-index-database.nixosModules.nix-index + ]; + programs.nix-index-database.comma.enable = true; + programs.nix-index.enableZshIntegration = false; + programs.nix-index.enableBashIntegration = false; +} diff --git a/base/systemd.nix b/base/systemd.nix new file mode 100644 index 0000000..ab0327b --- /dev/null +++ b/base/systemd.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + systemd.services."user@".serviceConfig.Delegate = "memory pids cpu cpuset"; + systemd.user.extraConfig = "LogLevel=debug"; + hm.systemd.user.startServices = "sd-switch"; +} diff --git a/home/programs/kitty.nix b/base/terminal.nix similarity index 60% rename from home/programs/kitty.nix rename to base/terminal.nix index aa5c486..1c2e7af 100644 --- a/home/programs/kitty.nix +++ b/base/terminal.nix @@ -1,17 +1,46 @@ { + pkgs, rice, + inputs, ... }: let - pal = rice.palette.hex; + inherit (pkgs) fish; in { - programs.kitty = { + imports = [ + inputs.culr.nixosModules.culr + ]; + programs.culr = { + enable = true; + pattern = "rainbow-split"; + }; + programs.fish = { + enable = true; + }; + programs.zoxide = { + enable = true; + enableFishIntegration = true; + }; + environment.systemPackages = [ + fish + ]; + environment.shells = [ fish ]; + users.defaultUserShell = fish; + console = { + font = "Lat2-Terminus16"; + }; + + environment.sessionVariables = { + EDITOR = "hx"; + }; + + hm.programs.kitty = { enable = true; font = { inherit (rice.fonts.monospace) name size; }; - settings = with pal; { + settings = with rice.palette.hex; { foreground = util.fg; background = util.bg; inherit (util) cursor; diff --git a/base/users.nix b/base/users.nix new file mode 100644 index 0000000..0514ece --- /dev/null +++ b/base/users.nix @@ -0,0 +1,16 @@ +{ lib, mainUser, ... }: +{ + services.userborn.enable = lib.mkDefault true; + nix.settings.trusted-users = [ mainUser ]; + users.users.${mainUser} = { + isNormalUser = true; + extraGroups = [ + "wheel" + ]; + }; + + hm.config.home = { + username = mainUser; + homeDirectory = "/home/${mainUser}"; + }; +} diff --git a/create.nix b/create.nix deleted file mode 100644 index ba939a8..0000000 --- a/create.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - system, - inputs, - sharedModules, - ... -}: -with inputs; -let - nix-rice = import "${inputs.nix-rice}/lib.nix" { - inherit (nixpkgs) lib; - kitty-themes-src = { }; - }; - rice = import ./rice { - inherit - inputs - system - nix-rice - ; - }; -in -{ - systems = - definitions: - nixpkgs.lib.mapAttrs ( - name: info: - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs rice; - mainUser = info.user; - }; - modules = - [ - ./system/${name}.nix - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - extraSpecialArgs = { - inherit inputs rice nix-rice; - mainUser = info.user; - }; - users.${info.user}.imports = [ - ./home/${info.user}.nix - ] ++ info.hmImports or [ ]; - }; - } - ] - ++ info.imports or [ ] - ++ sharedModules; - } - ) definitions; -} diff --git a/desktop/audio-control.nix b/desktop/audio-control.nix new file mode 100644 index 0000000..c7d6a12 --- /dev/null +++ b/desktop/audio-control.nix @@ -0,0 +1,13 @@ +{ + pkgs, + ... +}: +{ + hm.home.packages = builtins.attrValues { + inherit (pkgs) + avizo + playerctl + ; + }; + +} diff --git a/desktop/binds.nix b/desktop/binds.nix new file mode 100644 index 0000000..7a2bcc0 --- /dev/null +++ b/desktop/binds.nix @@ -0,0 +1,119 @@ +{ + pkgs, + lib, + config, + inputs, + ... +}: +let + inherit (lib) + range + nameValuePair + mapAttrs' + mergeAttrsList + ; + inherit (builtins) listToAttrs replaceStrings; + inherit (config.hm.lib.niri) actions; + hBinds = { + H = "left"; + L = "right"; + }; + vBinds = { + J = "down"; + K = "up"; + }; + makeDirBind = + mods: cmd: keys: + mapAttrs' ( + key: dir: + nameValuePair "${mods}+${key}" { + action = actions."${replaceStrings [ "$DIR" ] [ "${dir}" ] "${cmd}"}"; + } + ) keys; + makeWsBind = + mods: cmd: + listToAttrs ( + map (num: { + name = "${mods}+${builtins.toString num}"; + value = { + action."${cmd}" = num; + }; + }) (range 1 6) + ); + tagctl = lib.getExe' inputs.niri-tag.packages.${pkgs.system}.unstable "tagctl"; + makeTagBind = + mods: cmd: + listToAttrs ( + map (num: { + name = "${mods}+${builtins.toString num}"; + value = { + action.spawn = [ + tagctl + cmd + (builtins.toString num) + ]; + }; + }) (range 1 6) + ); +in +{ + hm.programs.niri.settings.binds = mergeAttrsList [ + { + "Mod+D".action.spawn = [ + "qs" + "ipc" + "call" + "launch" + "toggle" + ]; + "Mod+F".action.spawn = "firefox"; + "Mod+E".action.spawn = "nautilus"; + "Mod+Return".action.spawn = "kitty"; + "Mod+Shift+E".action.spawn = "wlogout"; + "Mod+Equal".action.spawn = "bitwarden"; + "Mod+Shift+Q".action = actions.close-window; + "Mod+Shift+S".action = actions.screenshot; + "Mod+R".action = actions.switch-preset-column-width; + "Mod+Shift+R".action = actions.maximize-column; + "XF86AudioRaiseVolume".action.spawn = [ + "volumectl" + "-u" + "up" + ]; + "XF86AudioLowerVolume".action.spawn = [ + "volumectl" + "-u" + "down" + ]; + "XF86AudioMute".action.spawn = [ + "volumectl" + "toggle-mute" + ]; + "XF86AudioStop".action.spawn = [ + "playerctl" + "stop" + ]; + "XF86AudioPlay".action.spawn = [ + "playerctl" + "play-pause" + ]; + "XF86AudioNext".action.spawn = [ + "playerctl" + "next" + ]; + "XF86AudioPrev".action.spawn = [ + "playerctl" + "previous" + ]; + "Mod+Space".action = actions.toggle-window-floating; + } + (makeDirBind "Mod" "focus-window-$DIR" vBinds) + (makeDirBind "Mod" "focus-column-or-monitor-$DIR" hBinds) + (makeDirBind "Mod+Shift" "move-column-$DIR-or-to-monitor-$DIR" hBinds) + (makeDirBind "Mod+Ctrl" "consume-or-expel-window-$DIR" hBinds) + (makeDirBind "Mod+Ctrl" "move-window-$DIR" vBinds) + (makeTagBind "Mod" "toggle-tag") + (makeTagBind "Mod+Shift" "toggle") + (makeTagBind "Mod+Ctrl" "exclusive-tag") + ]; +} diff --git a/system/modules/bootloader.nix b/desktop/boot.nix similarity index 85% rename from system/modules/bootloader.nix rename to desktop/boot.nix index 3bbf4f3..4b8baef 100644 --- a/system/modules/bootloader.nix +++ b/desktop/boot.nix @@ -1,8 +1,9 @@ +{ rice, ... }: { - rice, - ... -}: -{ + boot.tmp.useTmpfs = true; + + boot.initrd.systemd.enable = true; + boot.loader.limine = { enable = true; style = @@ -32,10 +33,5 @@ backdrop = pal.util.bg; }; maxGenerations = 5; - extraEntries = '' - /Windows - protocol: efi - path: boot():/EFI/Microsoft/Boot/bootmgfw.efi - ''; }; } diff --git a/home/programs/firefox.nix b/desktop/browser.nix similarity index 99% rename from home/programs/firefox.nix rename to desktop/browser.nix index cfbdf61..124cc95 100644 --- a/home/programs/firefox.nix +++ b/desktop/browser.nix @@ -21,7 +21,7 @@ let }; in { - programs.firefox = { + hm.programs.firefox = { enable = true; policies = { diff --git a/desktop/chat.nix b/desktop/chat.nix new file mode 100644 index 0000000..60663ca --- /dev/null +++ b/desktop/chat.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: +{ + hm.programs.firefox.webapps = { + "Microsoft-Teams" = { + url = "https://teams.microsoft.com"; + extraSettings = config.hm.programs.firefox.profiles.default.settings; + name = "Microsoft Teams"; + icon = ../assets/ms_teams.png; + }; + "Facebook-Messenger" = { + url = "https://www.messenger.com"; + extraSettings = config.hm.programs.firefox.profiles.default.settings; + name = "Facebook Messenger"; + icon = ../assets/fb_msg.png; + }; + }; + hm.home.packages = [ pkgs.cinny-desktop ]; +} diff --git a/home/modules/dev.nix b/desktop/dev.nix similarity index 63% rename from home/modules/dev.nix rename to desktop/dev.nix index 6b2aad8..c58c9f5 100644 --- a/home/modules/dev.nix +++ b/desktop/dev.nix @@ -12,7 +12,7 @@ in # ../programs/vscode.nix # ]; - home.packages = + hm.home.packages = getPkgs { inherit (pkgs) direnv @@ -65,48 +65,7 @@ in }) ]; - programs.zed-editor = { - enable = false; - extensions = [ - "nix" - "rust" - "ocaml" - "kanagawa-themes" - ]; - userSettings = { - features = { - copilot = false; - }; - buffer_font_family = rice.fonts.monospace.name; - buffer_font_size = rice.fonts.monospace.size; - theme = { - mode = "dark"; - dark = "Kanagawa Dragon"; - }; - telemetry = { - metrics = false; - diagnostics = false; - }; - vim_mode = true; - assistant = { - default_model = { - provider = "ollama"; - model = "llama3.2"; - }; - inline_alternatives = { - provider = "ollama"; - model = "starcoder2:3b"; - }; - }; - language_models = { - ollama = { - api_url = "http://localhost:11434"; - }; - }; - }; - }; - - programs.direnv = { + hm.programs.direnv = { enable = true; nix-direnv = { enable = true; @@ -114,13 +73,10 @@ in enableFishIntegration = true; }; - programs.git = { + hm.programs.git = { enable = true; userName = "atagen"; userEmail = "boss@atagen.co"; - extraConfig = { - credential.helper = "rbw"; - }; }; } diff --git a/desktop/documents.nix b/desktop/documents.nix new file mode 100644 index 0000000..1fb700f --- /dev/null +++ b/desktop/documents.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + hm.home.packages = builtins.attrValues { + inherit (pkgs) + libreoffice + thunderbird + ; + }; +} diff --git a/desktop/fm.nix b/desktop/fm.nix new file mode 100644 index 0000000..e93af84 --- /dev/null +++ b/desktop/fm.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + hm.home.packages = builtins.attrValues { + inherit (pkgs) + file-roller + nautilus + ; + }; + +} diff --git a/desktop/gfx-env.nix b/desktop/gfx-env.nix new file mode 100644 index 0000000..ac514a0 --- /dev/null +++ b/desktop/gfx-env.nix @@ -0,0 +1,14 @@ +{ + ... +}: +{ + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; + GBM_BACKEND = "nvidia-drm"; + NVD_BACKEND = "direct"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + LIBVA_DRIVER_NAME = "nvidia"; + __GL_GSYNC_ALLOWED = "1"; + __GL_VRR_ALLOWED = "1"; + }; +} diff --git a/desktop/hw.nix b/desktop/hw.nix new file mode 100644 index 0000000..46cc98f --- /dev/null +++ b/desktop/hw.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + hardware.enableRedistributableFirmware = true; + hardware.enableAllFirmware = true; +} diff --git a/desktop/input.nix b/desktop/input.nix new file mode 100644 index 0000000..7db5e0d --- /dev/null +++ b/desktop/input.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + services.libinput.enable = true; + console.useXkbConfig = true; + services.xserver.xkb.options = "caps:swapescape"; +} diff --git a/desktop/integrations.nix b/desktop/integrations.nix new file mode 100644 index 0000000..7697022 --- /dev/null +++ b/desktop/integrations.nix @@ -0,0 +1,38 @@ +{ + pkgs, + ... +}: +{ + xdg.autostart.enable = true; + xdg.portal.enable = true; + + hm.xdg = { + enable = true; + portal = + let + gtk = pkgs.xdg-desktop-portal-gtk; + gnome = pkgs.xdg-desktop-portal-gnome; + in + { + enable = true; + config = { + common = { + default = [ + "gnome" + ]; + }; + }; + extraPortals = [ + gnome + gtk + ]; + }; + }; + + environment.pathsToLink = [ + "/share/xdg-desktop-portal" + "/share/applications" + ]; + + security.polkit.enable = true; +} diff --git a/desktop/kernel.nix b/desktop/kernel.nix new file mode 100644 index 0000000..41c8ac2 --- /dev/null +++ b/desktop/kernel.nix @@ -0,0 +1,11 @@ +{ pkgs, inputs, ... }: +{ + imports = [ + inputs.nyx.nixosModules.default + ]; + services.scx = { + enable = true; + scheduler = "scx_bpfland"; + }; + boot.kernelPackages = pkgs.linuxPackages_cachyos; +} diff --git a/desktop/logout.nix b/desktop/logout.nix new file mode 100644 index 0000000..d16dfbf --- /dev/null +++ b/desktop/logout.nix @@ -0,0 +1,44 @@ +{ + rice, + pkgs, + ... +}: +let + pal = rice.palette.hex; +in +{ + hm.programs.wlogout = { + enable = true; + package = pkgs.wleave; + layout = builtins.fromJSON (builtins.readFile ./logout/layout); + style = + with pal; + (builtins.replaceStrings + [ + "/usr/share/wlogout" + "/etc/wlogout" + "#WINBG" + "#BTNCOL" + "#BTNBG" + "#BTNFOCUSBG" + "#WINLOGO" + ] + [ + "${pkgs.wlogout}/share/wlogout" + "${pkgs.wlogout}/etc/wlogout" + util.bg + bright.yellow + util.bg + normal.black + (builtins.path { + name = "winlogo"; + path = ../assets/winlogo.png; + sha256 = "7c1ff96b553c7a7ca3a7b7cf8efe830ab7feea92355aed288a10ee7347c24108"; + }) + ] + (builtins.readFile ./logout/style.css) + ); + }; + + hm.home.packages = [ pkgs.wleave ]; +} diff --git a/home/dots/wlogout/layout b/desktop/logout/layout similarity index 100% rename from home/dots/wlogout/layout rename to desktop/logout/layout diff --git a/desktop/logout/style.css b/desktop/logout/style.css new file mode 100644 index 0000000..4689381 --- /dev/null +++ b/desktop/logout/style.css @@ -0,0 +1,48 @@ +* { + background-image: none; +} +window { + background-color: #WINBG; +} +button { + color: #BTNCOL; + background-color: #BTNBG; + border-style: solid; + border-width: 2px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; +} + +button:focus, button:active, button:hover { + background-color: #BTNFOCUSBG; + outline-style: none; +} + +#lock { + background-image: image(url("/usr/share/wlogout/assets/lock.png"), url("/usr/local/share/wlogout/assets/lock.png")); +} + +#logout { + background-image: image(url("/usr/share/wlogout/assets/logout.png"), url("/usr/local/share/wlogout/assets/logout.png")); +} + +#suspend { + background-image: image(url("/usr/share/wlogout/assets/suspend.png"), url("/usr/local/share/wlogout/assets/suspend.png")); +} + +#hibernate { + background-image: image(url("/usr/share/wlogout/assets/hibernate.png"), url("/usr/local/share/wlogout/assets/hibernate.png")); +} + +#shutdown { + background-image: image(url("/usr/share/wlogout/assets/shutdown.png"), url("/usr/local/share/wlogout/assets/shutdown.png")); +} + +#reboot { + background-image: image(url("/usr/share/wlogout/assets/reboot.png"), url("/usr/local/share/wlogout/assets/reboot.png")); +} + +#windows { + background-image: image(url("#WINLOGO")) +} diff --git a/home/modules/media-players.nix b/desktop/media.nix similarity index 70% rename from home/modules/media-players.nix rename to desktop/media.nix index 87270a5..8cc11f8 100644 --- a/home/modules/media-players.nix +++ b/desktop/media.nix @@ -1,12 +1,11 @@ { pkgs, ... }: { - home.packages = builtins.attrValues { + hm.home.packages = builtins.attrValues { inherit (pkgs) mpv imv resonance zathura - playerctl feishin nicotine-plus ; diff --git a/desktop/network.nix b/desktop/network.nix new file mode 100644 index 0000000..20d18de --- /dev/null +++ b/desktop/network.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + networking.networkmanager.enable = true; + systemd.services.NetworkManager-wait-online.enable = true; + services.resolved = { + enable = true; + fallbackDns = [ + "103.1.206.179" + "168.138.8.38" + "168.138.12.137" + ]; + dnssec = "false"; + }; + services.mullvad-vpn.enable = true; +} diff --git a/home/programs/bitwarden.nix b/desktop/password-manager.nix similarity index 59% rename from home/programs/bitwarden.nix rename to desktop/password-manager.nix index 94f79b6..1fd5cab 100644 --- a/home/programs/bitwarden.nix +++ b/desktop/password-manager.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - programs.rbw = { + hm.programs.rbw = { enable = true; settings = { email = "boss@atagen.co"; @@ -8,6 +8,7 @@ base_url = "https://v.atagen.co"; }; }; + hm.programs.git.extraConfig.credential.helper = "rbw"; - home.packages = [ pkgs.bitwarden ]; + hm.home.packages = [ pkgs.bitwarden ]; } diff --git a/home/util/ez.nix b/desktop/quick-services.nix similarity index 64% rename from home/util/ez.nix rename to desktop/quick-services.nix index 678c565..9e97a4b 100644 --- a/home/util/ez.nix +++ b/desktop/quick-services.nix @@ -4,27 +4,20 @@ ... }: { - options = { - ezServices = + config.hm.options = { + quickServices = with lib; mkOption { type = with types; attrsOf str; default = { }; }; - ezOneShots = + quickOneShots = with lib; mkOption { type = with types; attrsOf str; default = { }; }; - ezConf = - with lib; - mkOption { - type = with types; attrsOf path; - default = { }; - }; - # for specifying an additional systemd target extraTarget = with lib; @@ -34,21 +27,21 @@ }; }; - config = { + config.hm.config = { systemd.user.services = builtins.mapAttrs (name: cmd: { Unit = { Description = "${name}"; - Requires = [ "graphical-session.target" ] ++ config.extraTarget; - After = [ "graphical-session.target" ] ++ config.extraTarget; + Requires = [ "graphical-session.target" ] ++ config.hm.extraTarget; + After = [ "graphical-session.target" ] ++ config.hm.extraTarget; }; Service = { ExecStart = cmd; }; Install = { - WantedBy = [ "graphical-session.target" ] ++ config.extraTarget; + WantedBy = [ "graphical-session.target" ] ++ config.hm.extraTarget; }; - }) config.ezServices + }) config.hm.quickServices // builtins.mapAttrs (name: cmd: { Unit = { Description = "${name}"; @@ -61,11 +54,6 @@ Install = { WantedBy = [ "graphical-session.target" ] ++ config.extraTarget; }; - }) config.ezOneShots; - - xdg.configFile = builtins.mapAttrs (_name: value: { - enable = true; - source = value; - }) config.ezConf; + }) config.hm.quickOneShots; }; } diff --git a/desktop/rice.nix b/desktop/rice.nix new file mode 100644 index 0000000..244a0c4 --- /dev/null +++ b/desktop/rice.nix @@ -0,0 +1,25 @@ +{ + pkgs, + lib, + inputs, + rice, + ... +}: +{ + hm.home.packages = + let + inherit (rice) icons fonts cursor; + in + fonts.pkgs + ++ icons.pkgs + ++ [ + cursor.package + ]; + _module.args.rice = import ../rice { + inherit + inputs + lib + pkgs + ; + }; +} diff --git a/desktop/shell.nix b/desktop/shell.nix new file mode 100644 index 0000000..58e8f24 --- /dev/null +++ b/desktop/shell.nix @@ -0,0 +1,62 @@ +{ + pkgs, + lib, + inputs, + rice, + ... +}: +let + inherit (lib) getExe getExe'; +in +{ + # quickshell stuff + environment.systemPackages = + builtins.attrValues { + inherit (pkgs.kdePackages) qtbase qtdeclarative; + inherit (pkgs) wl-clipboard; + } + ++ [ + (inputs.quickshell.packages.${pkgs.system}.default.override { + withHyprland = false; + withI3 = false; + }) + ]; + + hm.systemd.user.services.quickshell = { + Unit.PartOf = [ "graphical-session.target" ]; + Unit.After = [ + "graphical-session.target" + "niri.service" + ]; + Install.WantedBy = [ "graphical-session.target" ]; + Service = { + ExecStart = "${getExe' (inputs.quickshell.packages.${pkgs.system}.default.override { + withHyprland = false; + withI3 = false; + }) "qs"}"; + }; + }; + + hm.quickServices = { + "swaync" = "${getExe pkgs.swaynotificationcenter}"; + "swaybg" = "${getExe pkgs.swaybg} -m fill -i ${rice.bg.src}"; + "avizo-service" = "${getExe' pkgs.avizo "avizo-service"}"; + "swayidle" = + let + niri = inputs.niri.packages.${pkgs.system}.niri-unstable; + systemctl = getExe' pkgs.systemd "systemctl"; + in + '' + ${lib.getExe pkgs.swayidle} -w \ + timeout 1800 '${systemctl} suspend' \ + timeout 600 '${niri} msg action power-off-monitors' + ''; + }; + + hm.systemd.user.targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Requires = [ "graphical-session.target" ]; + }; + }; +} diff --git a/system/modules/sound.nix b/desktop/sound.nix similarity index 100% rename from system/modules/sound.nix rename to desktop/sound.nix diff --git a/home/modules/theming.nix b/desktop/theming.nix similarity index 75% rename from home/modules/theming.nix rename to desktop/theming.nix index 7436798..80c99f8 100644 --- a/home/modules/theming.nix +++ b/desktop/theming.nix @@ -1,17 +1,20 @@ { pkgs, rice, ... }: { - home.packages = [ + # for quickshell + qt.enable = true; + + hm.home.packages = [ pkgs.gtk-engine-murrine ]; - fonts.fontconfig.enable = true; + hm.fonts.fontconfig.enable = true; - qt = { + hm.qt = { enable = true; style.name = "adwaita-dark"; platformTheme.name = "adwaita"; }; - gtk = { + hm.gtk = { enable = true; theme = { inherit (rice.gtk-theme) package name; diff --git a/desktop/udisks.nix b/desktop/udisks.nix new file mode 100644 index 0000000..4f2ad7a --- /dev/null +++ b/desktop/udisks.nix @@ -0,0 +1,17 @@ +{ lib, pkgs, ... }: +{ + services.udisks2.enable = true; + hm.services.udiskie.enable = true; + # fix reliance on nonexistent graphical-session-pre.target + hm.systemd.user.services.udiskie = lib.mkForce { + Unit = { + Description = "udiskie mount daemon"; + After = [ ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service.ExecStart = [ "${pkgs.udiskie}/bin/udiskie --appindicator" ]; + + Install.WantedBy = [ "graphical-session.target" ]; + }; +} diff --git a/desktop/webapps.nix b/desktop/webapps.nix new file mode 100644 index 0000000..4559686 --- /dev/null +++ b/desktop/webapps.nix @@ -0,0 +1,14 @@ +{ config, ... }: +{ + imports = [ + ./webapps/firefox-webapp.nix + ]; + hm.programs.firefox.webapps = { + "Open-WebUI" = { + url = "http://127.0.0.1:8088"; + extraSettings = config.hm.programs.firefox.profiles.default.settings; + name = "Open-WebUI"; + icon = ../assets/openwebui.png; + }; + }; +} diff --git a/home/util/firefox-webapp.nix b/desktop/webapps/firefox-webapp.nix similarity index 95% rename from home/util/firefox-webapp.nix rename to desktop/webapps/firefox-webapp.nix index 7dbe7a5..e78d120 100644 --- a/home/util/firefox-webapp.nix +++ b/desktop/webapps/firefox-webapp.nix @@ -96,7 +96,7 @@ let ) cfg; in { - options.programs.firefox.webapps = mkOption { + config.hm.options.programs.firefox.webapps = mkOption { default = { }; type = @@ -210,8 +210,8 @@ in description = "Websites to create special site-specific Firefox instances for."; }; - config = { - programs.firefox.profiles = make-app-profiles (enumerate config.programs.firefox.webapps); + config.hm.config = { + programs.firefox.profiles = make-app-profiles (enumerate config.hm.programs.firefox.webapps); xdg.desktopEntries = mapAttrs (name: cfg: { inherit (cfg) @@ -235,7 +235,7 @@ in exec = concatStringsSep " " ( [ - "${getExe config.programs.firefox.package}" + "${getExe config.hm.programs.firefox.package}" "--name" "${name}" "--app-id" @@ -243,7 +243,7 @@ in "--class" "${name}" "-P" - "${config.programs.firefox.profiles."home-manager-webapp-${name}".path}" + "${config.hm.programs.firefox.profiles."home-manager-webapp-${name}".path}" "--no-remote" ] ++ cfg.extraArgs @@ -255,6 +255,6 @@ in StartupWMClass = "${name}"; NoDisplay = lib.boolToString cfg.hidden; }; - }) config.programs.firefox.webapps; + }) config.hm.programs.firefox.webapps; }; } diff --git a/home/util/local-webapp.nix b/desktop/webapps/local-webapp.nix similarity index 97% rename from home/util/local-webapp.nix rename to desktop/webapps/local-webapp.nix index a42c977..25d1268 100644 --- a/home/util/local-webapp.nix +++ b/desktop/webapps/local-webapp.nix @@ -29,7 +29,7 @@ let nameValuePair "${name}-client" { inherit (cfg) name; url = "http://127.0.0.1:${builtins.toString cfg.port}"; - extraSettings = config.programs.firefox.profiles.default.settings; + extraSettings = config.hm.programs.firefox.profiles.default.settings; hidden = true; } ) cfg; @@ -168,10 +168,10 @@ let '' }"; }) cfg; - cfg = config.localWebApps; + cfg = config.hm.localWebApps; in { - options.localWebApps = mkOption { + config.hm.options.localWebApps = mkOption { default = { }; type = with lib.types; @@ -240,7 +240,7 @@ in }); }; - config = { + config.hm.config = { programs.firefox.webapps = make-firefox cfg; systemd.user.targets = make-systemd-target cfg; diff --git a/desktop/wm.nix b/desktop/wm.nix new file mode 100644 index 0000000..ef59845 --- /dev/null +++ b/desktop/wm.nix @@ -0,0 +1,85 @@ +{ + pkgs, + mainUser, + rice, + inputs, + ... +}: +{ + imports = [ + inputs.niri.nixosModules.niri + inputs.niri-tag.nixosModules.niri-tag + ]; + hm.programs.niri.settings = { + input = { + warp-mouse-to-focus.enable = true; + }; + cursor = { + hide-after-inactive-ms = 5000; + hide-when-typing = true; + size = 16; + theme = rice.cursor.name; + }; + layout = { + always-center-single-column = true; + gaps = 24; + default-column-width.proportion = 0.5; + preset-column-widths = map (p: { proportion = p; }) [ + (2.0 / 3.0) + 0.5 + (1.0 / 3.0) + ]; + focus-ring = + let + pal = rice.palette.hex; + in + { + active = { + color = pal.bright.yellow; + }; + inactive = { + color = pal.normal.black; + }; + }; + }; + prefer-no-csd = true; + hotkey-overlay.skip-at-startup = true; + window-rules = + let + v = 10.0; + in + [ + { + geometry-corner-radius = { + bottom-left = v; + bottom-right = 0.0; + top-left = 0.0; + top-right = v; + }; + clip-to-geometry = true; + } + ]; + }; + + services.greetd = { + enable = true; + restart = false; + settings = + let + session = { + command = "niri-session"; + user = "${mainUser}"; + }; + in + { + default_session = session; + initial_session = session; + }; + }; + programs.niri = { + enable = true; + package = inputs.niri.packages.${pkgs.system}.niri-unstable; + }; + services.niri-tag.enable = true; + +} diff --git a/entry.nix b/entry.nix index dd060a2..ce1b21d 100644 --- a/entry.nix +++ b/entry.nix @@ -1,33 +1,23 @@ let - inputs = import ./inputs.nix; - modules = import ./util/get-modules.nix inputs; - create = import ./create.nix { - system = "x86_64-linux"; - inherit inputs; - sharedModules = - with inputs; - (modules [ - culr - meat - niri - niri-tag - lix-module - angrr - arbys - # smooooth - ]) - ++ [ - nix-index-database.nixosModules.nix-index - ./system/substituters.nix - ]; - }; + create = import ./util/create.nix; in { nixosConfigurations = create.systems { quiver = { user = "bolt"; - imports = with inputs; (modules [ nyx ]); + imports = [ + ./base + ./desktop + ./hosts/quiver + ]; + }; + adrift = { + user = "plank"; + imports = [ + ./base + ./desktop + ./hosts/adrift + ]; }; - adrift.user = "plank"; }; } diff --git a/flake.nix b/flake.nix index a8caf69..f8164ea 100644 --- a/flake.nix +++ b/flake.nix @@ -103,8 +103,6 @@ angrr.url = "github:linyinfeng/angrr"; - arbys.url = "path:/home/bolt/code/arbys"; - __flake-compat = { url = "git+https://git.lix.systems/lix-project/flake-compat.git"; flake = false; diff --git a/flakes/comfyui-plugins/essentials/default.nix b/flakes/comfyui-plugins/essentials/default.nix deleted file mode 100644 index e8b24ca..0000000 --- a/flakes/comfyui-plugins/essentials/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - pkgs, - src, - python3Packages, - ... -}: -let - inherit (python3Packages) - numba - colour-science - rembg - pixeloe - transparent-background - ; -in -pkgs.stdenvNoCC.mkDerivation { - pname = "comfyui-essentials"; - version = "dev-${builtins.toString src.lastModified}"; - inherit src; - - propagatedBuildInputs = [ - numba - colour-science - rembg - pixeloe - transparent-background - ]; -} diff --git a/flakes/comfyui-plugins/flake.lock b/flakes/comfyui-plugins/flake.lock deleted file mode 100644 index ed0ef70..0000000 --- a/flakes/comfyui-plugins/flake.lock +++ /dev/null @@ -1,75 +0,0 @@ -{ - "nodes": { - "gguf": { - "flake": false, - "locked": { - "lastModified": 1736350217, - "narHash": "sha256-3RqFfvXdn9sCIlctqa14c2fvluSmJCR+llfZo/MV64o=", - "owner": "city96", - "repo": "ComfyUI-GGUF", - "rev": "5875c52f59baca3a9372d68c43a3775e21846fe0", - "type": "github" - }, - "original": { - "owner": "city96", - "repo": "ComfyUI-GGUF", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1738410390, - "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", - "path": "/nix/store/hjb1rqv2mfs5ny47amj2gsc8xk05x5g6-source", - "rev": "3a228057f5b619feb3186e986dbe76278d707b6e", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "openpose": { - "flake": false, - "locked": { - "lastModified": 1685841563, - "narHash": "sha256-GUjs8mIUFAbjJEVL+EsT44HG42mAiumKOBlBas1xxrM=", - "owner": "space-nuko", - "repo": "ComfyUI-OpenPose-Editor", - "rev": "4d8fe730acdb11ab2fcd592129d91d338d270adf", - "type": "github" - }, - "original": { - "owner": "space-nuko", - "repo": "ComfyUI-OpenPose-Editor", - "type": "github" - } - }, - "root": { - "inputs": { - "gguf": "gguf", - "nixpkgs": "nixpkgs", - "openpose": "openpose", - "tensorrt": "tensorrt" - } - }, - "tensorrt": { - "flake": false, - "locked": { - "lastModified": 1728519788, - "narHash": "sha256-tqiodF60IVlmvJknYxEwL0U7GIrrfl49k6Tg+8jGRVU=", - "owner": "comfyanonymous", - "repo": "ComfyUI_TensorRT", - "rev": "5bcc3f1e5c2424bb20bcb586e340c25ebe4a954f", - "type": "github" - }, - "original": { - "owner": "comfyanonymous", - "repo": "ComfyUI_TensorRT", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flakes/comfyui-plugins/flake.nix b/flakes/comfyui-plugins/flake.nix deleted file mode 100644 index 14c93b8..0000000 --- a/flakes/comfyui-plugins/flake.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - inputs = { - gguf = { - url = "github:city96/ComfyUI-GGUF"; - flake = false; - }; - - tensorrt = { - url = "github:comfyanonymous/ComfyUI_TensorRT"; - flake = false; - }; - - # needs some deps packaged - # essentials = { - # url = "github:cubiq/ComfyUI_essentials"; - # flake = false; - # }; - - openpose = { - url = "github:space-nuko/ComfyUI-OpenPose-Editor"; - flake = false; - }; - }; - - outputs = - { - self, - nixpkgs, - ... - }: - let - pkgs = import nixpkgs { - system = "x86_64-linux"; - }; - inherit (pkgs) lib callPackage; - inherit (builtins) mapAttrs; - filteredInputs = lib.filterAttrs (n: _v: n != "nixpkgs") self.inputs; - in - { - overlays.comfyui-plugins = final: _prev: { - comfyui-plugins = mapAttrs ( - name: value: final.callPackage ./${name}/default.nix { src = value; } - ) filteredInputs; - }; - packages.x86_64-linux = mapAttrs ( - name: value: callPackage ./${name}/default.nix { src = value; } - ) filteredInputs; - }; -} diff --git a/flakes/comfyui-plugins/gguf/default.nix b/flakes/comfyui-plugins/gguf/default.nix deleted file mode 100644 index 0d116c7..0000000 --- a/flakes/comfyui-plugins/gguf/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs, - src, - python3Packages, - ... -}: -let - inherit (python3Packages) gguf numpy pyyaml; -in -pkgs.stdenvNoCC.mkDerivation { - pname = "comfyui-gguf"; - version = "dev-${builtins.toString src.lastModified}"; - inherit src; - propagatedBuildInputs = [ - gguf - numpy - pyyaml - ]; - installPhase = '' - mkdir -p $out - cp -r * $out/ - ''; -} diff --git a/flakes/comfyui-plugins/openpose/default.nix b/flakes/comfyui-plugins/openpose/default.nix deleted file mode 100644 index 9adf02c..0000000 --- a/flakes/comfyui-plugins/openpose/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - pkgs, - src, - ... -}: -pkgs.stdenvNoCC.mkDerivation { - pname = "comfyui-openpose-editor"; - version = "dev-${builtins.toString src.lastModified}"; - inherit src; - - patches = [ - ./openpose_no_update.patch - ]; - - installPhase = '' - mkdir -p $out - cp -r * $out/ - cp js/* $out/ - ''; -} diff --git a/flakes/comfyui-plugins/openpose/openpose_no_update.patch b/flakes/comfyui-plugins/openpose/openpose_no_update.patch deleted file mode 100644 index 2f440de..0000000 --- a/flakes/comfyui-plugins/openpose/openpose_no_update.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/__init__.py b/__init__.py -index e4cf8bb..7d8f894 100644 ---- a/__init__.py -+++ b/__init__.py -@@ -35,6 +35,6 @@ def update_javascript(): - shutil.copy(src_file, dst_file) - - --update_javascript() -+# update_javascript() - - print('\033[34mOpenPose Editor: \033[92mLoaded\033[0m') diff --git a/flakes/comfyui-plugins/tensorrt/default.nix b/flakes/comfyui-plugins/tensorrt/default.nix deleted file mode 100644 index 383a2ac..0000000 --- a/flakes/comfyui-plugins/tensorrt/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - pkgs, - src, - python3Packages, - ... -}: -let - inherit (python3Packages) tensorrt onnx; -in -pkgs.stdenvNoCC.mkDerivation { - pname = "comfyui-tensorrt"; - version = "dev-${builtins.toString src.lastModified}"; - inherit src; - - propagatedBuildInputs = [ - tensorrt - onnx - ]; - - installPhase = '' - mkdir -p $out - cp -r * $out - ''; -} diff --git a/flakes/comfyui/default.nix b/flakes/comfyui/default.nix deleted file mode 100644 index 1d4fb7f..0000000 --- a/flakes/comfyui/default.nix +++ /dev/null @@ -1,96 +0,0 @@ -{ - pkgs, - lib, - config, - comfyui, - comfy_dir ? "/run/user/1000/comfyui/", - spandrel, - plugins ? config.comfyui.plugins or [ ], - ... -}: -let - inherit (pkgs) python3; - inherit (pkgs.python3Packages) - torch - torchsde - torchvision - torchaudio - einops - transformers - tokenizers - sentencepiece - safetensors - aiohttp - pyyaml - pillow - scipy - tqdm - psutil - kornia - soundfile - ; - - python = python3.buildEnv.override { - extraLibs = [ - torch - torchsde - torchvision - torchaudio - einops - transformers - tokenizers - sentencepiece - safetensors - aiohttp - pyyaml - pillow - scipy - tqdm - psutil - kornia - soundfile - - spandrel - ] ++ plugins; - }; -in -pkgs.stdenvNoCC.mkDerivation { - name = "comfyui"; - pname = "comfyui"; - version = "dev-${builtins.toString comfyui.lastModified}"; - src = comfyui; - nativeBuildInputs = - let - inherit (pkgs) makeWrapper; - in - [ - makeWrapper - ]; - propagatedBuildInputs = - let - inherit (pkgs.cudaPackages) cudatoolkit; - in - [ - python - cudatoolkit - ]; - - patches = [ ./folder_paths.patch ]; - - installPhase = - let - launcher = pkgs.writeShellScript "launch.sh" '' - mkdir -p $COMFY_DIR/custom_nodes - mkdir -p $COMFY_DIR/models/{checkpoints,configs,loras,vae,clip,unet,diffusion_models,clip_vision,style_models,embeddings,diffusers,vae_approx,controlnet,gligen,upscale_models,hypernetworks,photomaker,classifiers} - ${python}/bin/python3 $COMFY/comfyui/main.py --output-directory $(mktemp) - ''; - in - '' - mkdir -p $out/comfyui - cp -r * $out/comfyui - mkdir -p $out/bin - makeWrapper ${launcher} $out/bin/comfyui --prefix PATH : ${lib.makeBinPath [ python ]} \ - --set PYTHONPATH ${lib.makeLibraryPath [ python ]} --set COMFY $out --set COMFY_DIR ${comfy_dir} - ''; - meta.mainProgram = "comfyui"; -} diff --git a/flakes/comfyui/flake.lock b/flakes/comfyui/flake.lock deleted file mode 100644 index 805bbb0..0000000 --- a/flakes/comfyui/flake.lock +++ /dev/null @@ -1,41 +0,0 @@ -{ - "nodes": { - "comfyui": { - "flake": false, - "locked": { - "lastModified": 1739165060, - "narHash": "sha256-DLiv96ynd+p4lXgvNMqgSklWFciLX+l+nXlu5MYVrg8=", - "owner": "comfyanonymous", - "repo": "ComfyUI", - "rev": "4027466c802d174d76347726d74de73c39acedb3", - "type": "github" - }, - "original": { - "owner": "comfyanonymous", - "repo": "ComfyUI", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1738410390, - "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", - "path": "/nix/store/hjb1rqv2mfs5ny47amj2gsc8xk05x5g6-source", - "rev": "3a228057f5b619feb3186e986dbe76278d707b6e", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "comfyui": "comfyui", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flakes/comfyui/flake.nix b/flakes/comfyui/flake.nix deleted file mode 100644 index 58b690f..0000000 --- a/flakes/comfyui/flake.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - inputs = { - comfyui = { - url = "github:comfyanonymous/ComfyUI"; - flake = false; - }; - }; - - nixConfig = { - extra-substituters = [ - "https://nix-community.cachix.org" - "https://cuda-maintainers.cachix.org" - ]; - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" - ]; - }; - - outputs = - { - self, - nixpkgs, - comfyui, - }: - { - homeManagerModules.comfyui = import ./module.nix; - - overlays.comfyui = final: _prev: { - comfyui = - let - spandrel = final.callPackage ./spandrel.nix { }; - in - final.callPackage ./default.nix { - cudaSupport = true; - inherit comfyui spandrel; - }; - }; - - packages.x86_64-linux = - let - system = "x86_64-linux"; - pkgs = import nixpkgs { - config.allowUnfree = true; - config.cudaSupport = true; - inherit system; - }; - spandrel = pkgs.callPackage ./spandrel.nix { }; - in - { - default = pkgs.callPackage ./default.nix { - inherit comfyui spandrel; - }; - }; - }; -} diff --git a/flakes/comfyui/folder_paths.patch b/flakes/comfyui/folder_paths.patch deleted file mode 100644 index 457a571..0000000 --- a/flakes/comfyui/folder_paths.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/folder_paths.py b/folder_paths.py -index 01ae821..27906ac 100644 ---- a/folder_paths.py -+++ b/folder_paths.py -@@ -11,7 +11,7 @@ supported_pt_extensions: set[str] = {'.ckpt', '.pt', '.bin', '.pth', '.safetenso - - folder_names_and_paths: dict[str, tuple[list[str], set[str]]] = {} - --base_path = os.path.dirname(os.path.realpath(__file__)) -+base_path = os.path.dirname(os.environ['COMFY_DIR']) - models_dir = os.path.join(base_path, "models") - folder_names_and_paths["checkpoints"] = ([os.path.join(models_dir, "checkpoints")], supported_pt_extensions) - folder_names_and_paths["configs"] = ([os.path.join(models_dir, "configs")], [".yaml"]) -@@ -39,10 +39,10 @@ folder_names_and_paths["photomaker"] = ([os.path.join(models_dir, "photomaker")] - - folder_names_and_paths["classifiers"] = ([os.path.join(models_dir, "classifiers")], {""}) - --output_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "output") --temp_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "temp") --input_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "input") --user_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "user") -+output_directory = os.path.join(base_path, "output") -+temp_directory = os.path.join(base_path, "temp") -+input_directory = os.path.join(base_path, "input") -+user_directory = os.path.join(base_path, "user") - - filename_list_cache: dict[str, tuple[list[str], dict[str, float], float]] = {} - diff --git a/flakes/comfyui/module.nix b/flakes/comfyui/module.nix deleted file mode 100644 index 1c6f715..0000000 --- a/flakes/comfyui/module.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -let - inherit (lib) - mkEnableOption - mkOption - types - hasSuffix - ; - cfg = config.programs.comfyui; - # comfyui only understands the path properly with a trailing slash - getStorage = if (hasSuffix "/" cfg.storage) then cfg.storage else cfg.storage + "/"; -in -{ - options.programs.comfyui = { - enable = mkEnableOption "ComfyUI"; - storage = mkOption { - type = types.path; - description = "where to source models and store information"; - }; - plugins = mkOption { - type = with types; listOf package; - description = "list of comfyui plugins"; - default = [ ]; - }; - }; - config = lib.mkIf cfg.enable { - home.packages = [ - # pkgs.comfyui - (pkgs.comfyui.override { - comfy_dir = getStorage; - inherit (cfg) plugins; - }) - ]; - home.file = builtins.listToAttrs ( - map (pkg: { - name = "${getStorage}/custom_nodes/${pkg.name}"; - value = { - recursive = true; - source = "${pkg}"; - }; - }) cfg.plugins - ); - }; -} diff --git a/flakes/comfyui/spandrel.nix b/flakes/comfyui/spandrel.nix deleted file mode 100644 index 7c7d740..0000000 --- a/flakes/comfyui/spandrel.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - python3Packages, - fetchPypi, - ... -}: -python3Packages.buildPythonPackage rec { - pname = "spandrel"; - version = "0.4.0"; - pyproject = true; - - src = fetchPypi { - inherit pname version; - hash = "sha256-9FUmiT+SOhLvN1QsROREsSCJdlk7x8zfpU/QTHw+gMo="; - }; - - build-system = - let - inherit (python3Packages) setuptools; - in - [ - setuptools - ]; - - dependencies = - let - inherit (python3Packages) - torch - torchvision - safetensors - numpy - einops - typing-extensions - ; - in - [ - torch - torchvision - safetensors - numpy - einops - typing-extensions - ]; - - doCheck = false; -} diff --git a/flakes/niri-session-manager/flake.lock b/flakes/niri-session-manager/flake.lock deleted file mode 100644 index b5285a9..0000000 --- a/flakes/niri-session-manager/flake.lock +++ /dev/null @@ -1,41 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1749285348, - "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", - "path": "/nix/store/syvnmj3hhckkbncm94kfkbl76qsdqqj3-source", - "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs", - "src": "src" - } - }, - "src": { - "flake": false, - "locked": { - "lastModified": 1741050520, - "narHash": "sha256-bTOxv5yZh6wgCs7ADUFKdlXGtlIckkSijGV8G7ToVy4=", - "owner": "MTeaHead", - "repo": "niri-session-manager", - "rev": "e8732380991bd629a7e6c3fb5ea50317084fb1eb", - "type": "github" - }, - "original": { - "owner": "MTeaHead", - "repo": "niri-session-manager", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flakes/niri-session-manager/flake.nix b/flakes/niri-session-manager/flake.nix deleted file mode 100644 index ee1cd01..0000000 --- a/flakes/niri-session-manager/flake.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ - inputs = { - src = { - url = "github:MTeaHead/niri-session-manager"; - flake = false; - }; - }; - - outputs = - { - nixpkgs, - src, - self, - }: - { - packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.rustPlatform.callPackage ( - { pkgs, buildRustPackage }: - buildRustPackage (finalAttrs: { - pname = "niri-session-manager"; - version = "git-${src.rev or src.dirtyRev or "dirty"}"; - inherit src; - - cargoLock = { - lockFile = "${src}/Cargo.lock"; - }; - - meta.mainProgram = "niri-session-manager"; - }) - ) { }; - - nixosModules.niri-session-manager = - { - config, - lib, - pkgs, - ... - }: - { - options = { - services.niri-session-manager = { - enable = lib.mkEnableOption "Niri Session Manager"; - }; - }; - config = - let - cfg = config.services.niri-session-manager; - in - lib.mkIf cfg.enable { - systemd.user.services.niri-session-manager = { - enable = true; - description = "Niri Session Manager"; - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - wants = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - serviceConfig = { - Type = "simple"; - Restart = "always"; - ExecStart = "${self.packages.${pkgs.system}.default}"; - PrivateTmp = true; - }; - }; - }; - }; - }; -} diff --git a/home/bolt.nix b/home/bolt.nix deleted file mode 100644 index b9f796e..0000000 --- a/home/bolt.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - ... -}: -{ - - imports = [ - ./home.nix - ]; - -} diff --git a/home/dots/Xresources b/home/dots/Xresources deleted file mode 100644 index af1d2c9..0000000 --- a/home/dots/Xresources +++ /dev/null @@ -1,37 +0,0 @@ - -! special -*.foreground: #d3dae3 -*.background: #181b28 -*.cursorColor: #d3dae3 - -! black -*.color0: #2f343f -*.color8: #1e2233 - -! red -*.color1: #ed244e -*.color9: #da4453 - -! green -*.color2: #27ae60 -*.color10: #71f79f - -! yellow -*.color3: #f67400 -*.color11: #fdbc4b - -! blue -*.color4: #2980b9 -*.color12: #1d99f3 - -! magenta -*.color5: #c50ed2 -*.color13: #9b59b6 - -! cyan -*.color6: #3daee9 -*.color14: #5294e2 - -! white -*.color7: #a1a9b1 -*.color15: #656a73 \ No newline at end of file diff --git a/home/dots/wlogout/style.css b/home/dots/wlogout/style.css deleted file mode 100644 index ce6b1fd..0000000 --- a/home/dots/wlogout/style.css +++ /dev/null @@ -1,48 +0,0 @@ -* { - background-image: none; -} -window { - background-color: #WINBG; -} -button { - color: #BTNCOL; - background-color: #BTNBG; - border-style: solid; - border-width: 2px; - background-repeat: no-repeat; - background-position: center; - background-size: 25%; -} - -button:focus, button:active, button:hover { - background-color: #BTNFOCUSBG; - outline-style: none; -} - -#lock { - background-image: image(url("/usr/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png")); -} - -#logout { - background-image: image(url("/usr/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png")); -} - -#suspend { - background-image: image(url("/usr/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png")); -} - -#hibernate { - background-image: image(url("/usr/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png")); -} - -#shutdown { - background-image: image(url("/usr/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png")); -} - -#reboot { - background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png")); -} - -#windows { - background-image: image(url("#WINLOGO")) -} diff --git a/home/dots/zsh b/home/dots/zsh deleted file mode 100644 index 1a13aa9..0000000 --- a/home/dots/zsh +++ /dev/null @@ -1,44 +0,0 @@ -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - -la_culr() -{ - eza -lha --group-directories-first --icons --color=always $@ | culr -t 80 -o roygbiv-split -} - -ls_culr() -{ - eza -lh --group-directories-first --icons --color=always $@ | culr -t 80 -o roygbiv-split -} - -ps_culr() -{ - ps ww$@ | culr -t 80 -o roygbiv-split -} - -alias ...='cd ../..' -alias ....='cd ../../..' -alias .....='cd ../../../..' - -alias fresh='clear; echo; ~/.nix/header.sh' -alias icat='kitty +kitten icat' -alias chmox='chmod +x' -alias gs='git status' -alias gcl='git clone' -alias ga='git add' -alias gcb='git checkout -b' -alias gco='git checkout' -alias gl='git pull' -alias gp='git push' -alias gd='git diff' -alias gcam='git commit -am' -alias gcm='git commit -m' -alias gr='git restore' -alias gm='git merge' -alias l='ls_culr' -alias la='la_culr' -alias p='ps_culr' -alias mnt='mount | column -t | culr -t 80 -o roygbiv-split' -alias zz='z $(xplr)' -# alias kaboom='printf "type any input if you wish to update\n\npress enter to continue\n"; read upgrade; if [ -n "$upgrade" ]; then echo upgrading..; sudo nix-channel --update; else echo no upgrade!; fi; sudo nixos-rebuild switch -j9 && rm ~/.gtkrc-2.0; home-manager switch && sudo nix-collect-garbage && nix-store --optimise' -eval "$(zoxide init zsh)" -fresh diff --git a/home/home.nix b/home/home.nix deleted file mode 100644 index 0f069fd..0000000 --- a/home/home.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ - inputs, - lib, - pkgs, - rice, - ... -}: -{ - home.stateVersion = "22.11"; - - imports = [ - ./modules/cli.nix - ./modules/desktop.nix - ./modules/dev.nix - ./modules/theming.nix - ./modules/niri.nix - ./util/ez.nix - ./util/name.nix - inputs.nix-index-database.hmModules.nix-index - ]; - - nix.gc = { - automatic = true; - frequency = "daily"; - options = "--delete-older-than 14d"; - }; - - xdg = { - enable = true; - portal = - let - gtk = pkgs.xdg-desktop-portal-gtk; - gnome = pkgs.xdg-desktop-portal-gnome; - in - { - enable = true; - config = { - common = { - default = [ - "gnome" - ]; - }; - }; - extraPortals = [ - gnome - gtk - ]; - }; - }; - - home.packages = - let - inherit (rice) icons fonts cursor; - in - fonts.pkgs - ++ icons.pkgs - ++ [ - cursor.package - pkgs.tauon - ]; - - systemd.user.targets.tray = { - Unit = { - Description = "Home Manager System Tray"; - Requires = [ "graphical-session.target" ]; - }; - }; - - services.syncthing = { - enable = true; - }; - - services.udiskie.enable = true; - # fix reliance on nonexistent graphical-session-pre.target - systemd.user.services.udiskie = lib.mkForce { - Unit = { - Description = "udiskie mount daemon"; - After = [ ]; - PartOf = [ "graphical-session.target" ]; - }; - - Service.ExecStart = [ "${pkgs.udiskie}/bin/udiskie --appindicator" ]; - - Install.WantedBy = [ "graphical-session.target" ]; - }; - - # programs.nix-index-database.comma.enable = true; - # programs.nix-index = { - # enable = true; - # enableZshIntegration = false; - # enableBashIntegration = false; - # }; - # programs.command-not-found.enable = false; - # programs.nix-index.enable = true; - - systemd.user.startServices = "sd-switch"; - ezServices = { - ckb-next = "${lib.getExe pkgs.ckb-next} -c -b"; - }; -} diff --git a/home/homepkgs/culr.nix b/home/homepkgs/culr.nix deleted file mode 100755 index 0dfa0a0..0000000 --- a/home/homepkgs/culr.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - lib, - fetchFromGitea, - rustPlatform, - libX11, - pkg-config, -}: - -rustPlatform.buildRustPackage rec { - pname = "culr"; - version = "0.1.0"; - - src = fetchFromGitea { - domain = "git.atagen.co"; - owner = "atagen"; - repo = pname; - rev = "8cb1323bdc388ce1fdb0675ade756ea8b59b803d"; - sha256 = "sha256-Blo1PyhzKU4LzflmeGrvWOQEon2BCTkF3uQR+7D5/kc="; - }; - - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ libX11 ]; - - cargoSha256 = "sha256-d8MshgH3EppKR80fULU5kraJzrkG57KApzcJM2muvIE="; - - meta = with lib; { - description = "colourise piped input"; - homepage = "https://git.atagen.co/atagen/culr"; - license = licenses.mit; - maintainers = [ ]; - }; - -} diff --git a/home/icons/syncthing.png b/home/icons/syncthing.png deleted file mode 100644 index cce2b8e..0000000 Binary files a/home/icons/syncthing.png and /dev/null differ diff --git a/home/modules/chat.nix b/home/modules/chat.nix deleted file mode 100644 index c69e984..0000000 --- a/home/modules/chat.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ - ../util/firefox-webapp.nix - ]; - programs.firefox.webapps = { - "Microsoft-Teams" = { - url = "https://teams.microsoft.com"; - # id = 1; - extraSettings = config.programs.firefox.profiles.default.settings; - name = "Microsoft Teams"; - icon = ../icons/ms_teams.png; - }; - "Facebook-Messenger" = { - url = "https://www.messenger.com"; - # id = 2; - extraSettings = config.programs.firefox.profiles.default.settings; - name = "Facebook Messenger"; - icon = ../icons/fb_msg.png; - }; - }; - home.packages = [ pkgs.cinny-desktop ]; -} diff --git a/home/modules/cli.nix b/home/modules/cli.nix deleted file mode 100644 index 0c7b494..0000000 --- a/home/modules/cli.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ../programs/kitty.nix - # ../programs/zsh.nix - # ../programs/xresources.nix - ../programs/helix.nix - # ../programs/atuin.nix - ]; - home.packages = builtins.attrValues { - inherit (pkgs) - btop-cuda - bat - ripgrep - fd - lazygit - zoxide - zellij - ouch - ; - }; -} diff --git a/home/modules/creative.nix b/home/modules/creative.nix deleted file mode 100644 index e420aa3..0000000 --- a/home/modules/creative.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: { - # imports = [ - # ../util/flatpak.nix - # ]; - # flatpaks = [ - # "ar.com.tuxguitar.TuxGuitar" - # "org.inkscape.Inkscape" - # "com.github.PintaProject.Pinta" - # ]; -} diff --git a/home/modules/desktop.nix b/home/modules/desktop.nix deleted file mode 100644 index 391a3b5..0000000 --- a/home/modules/desktop.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./media-players.nix - ./webapps.nix - ./documents.nix - # ./creative.nix - ./chat.nix - ../programs/firefox.nix - ../programs/wlogout.nix - ../programs/bitwarden.nix - ]; - home.packages = builtins.attrValues { - inherit (pkgs) - file-roller - nautilus - thunderbird - ; - }; -} diff --git a/home/modules/documents.nix b/home/modules/documents.nix deleted file mode 100644 index c8f059d..0000000 --- a/home/modules/documents.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = [ - pkgs.libreoffice - ]; -} diff --git a/home/modules/niri.nix b/home/modules/niri.nix deleted file mode 100644 index 0f54082..0000000 --- a/home/modules/niri.nix +++ /dev/null @@ -1,288 +0,0 @@ -{ - pkgs, - lib, - config, - rice, - inputs, - ... -}: -let - services = - let - inherit (pkgs) swaynotificationcenter; - in - [ - swaynotificationcenter - ]; - errata = - let - inherit (pkgs) avizo playerctl; - in - [ - avizo - playerctl - ]; - extraServices = - let - inherit (pkgs) - swayidle - swaybg - systemd - avizo - ; - - inherit (inputs.niri.packages.x86_64-linux) niri-unstable; - in - [ - { - name = "swaybg"; - value = "${lib.getExe swaybg} -m fill -i ${rice.bg.src}"; - } - { - name = "avizo-service"; - value = "${lib.getExe' avizo "avizo-service"}"; - } - { - name = "swayidle"; - value = - let - niri = lib.getExe niri-unstable; - systemctl = lib.getExe' systemd "systemctl"; - in - '' - ${lib.getExe swayidle} -w \ - timeout 1800 '${systemctl} suspend' \ - timeout 600 '${niri} msg action power-off-monitors' - ''; - } - ]; -in -{ - home.packages = errata; - ezServices = builtins.listToAttrs ( - (map (entry: { - name = "${lib.strings.toLower entry.pname}"; - value = "${lib.getExe entry}"; - }) services) - ++ extraServices - ); - programs.niri.settings = - let - inherit (lib) - range - nameValuePair - mapAttrs' - mergeAttrsList - ; - inherit (builtins) listToAttrs replaceStrings; - inherit (config.lib.niri) actions; - in - { - binds = - let - hBinds = { - H = "left"; - L = "right"; - }; - vBinds = { - J = "down"; - K = "up"; - }; - makeDirBind = - mods: cmd: keys: - mapAttrs' ( - key: dir: - nameValuePair "${mods}+${key}" { - action = actions."${replaceStrings [ "$DIR" ] [ "${dir}" ] "${cmd}"}"; - } - ) keys; - makeWsBind = - mods: cmd: - listToAttrs ( - map (num: { - name = "${mods}+${builtins.toString num}"; - value = { - action."${cmd}" = num; - }; - }) (range 1 6) - ); - tagctl = lib.getExe' inputs.niri-tag.packages.${pkgs.system}.unstable "tagctl"; - makeTagBind = - mods: cmd: - listToAttrs ( - map (num: { - name = "${mods}+${builtins.toString num}"; - value = { - action.spawn = [ - tagctl - cmd - (builtins.toString num) - ]; - }; - }) (range 1 6) - ); - in - mergeAttrsList [ - { - "Mod+D".action.spawn = [ - "qs" - "ipc" - "call" - "launch" - "toggle" - ]; - "Mod+F".action.spawn = "firefox"; - "Mod+E".action.spawn = "nautilus"; - "Mod+Return".action.spawn = "kitty"; - "Mod+Shift+E".action.spawn = "wlogout"; - "Mod+Equal".action.spawn = "bitwarden"; - "Mod+Shift+Q".action = actions.close-window; - "Mod+Shift+S".action = actions.screenshot; - "Mod+R".action = actions.switch-preset-column-width; - "Mod+Shift+R".action = actions.maximize-column; - "XF86AudioRaiseVolume".action.spawn = [ - "volumectl" - "-u" - "up" - ]; - "XF86AudioLowerVolume".action.spawn = [ - "volumectl" - "-u" - "down" - ]; - "XF86AudioMute".action.spawn = [ - "volumectl" - "toggle-mute" - ]; - "XF86AudioStop".action.spawn = [ - "playerctl" - "stop" - ]; - "XF86AudioPlay".action.spawn = [ - "playerctl" - "play-pause" - ]; - "XF86AudioNext".action.spawn = [ - "playerctl" - "next" - ]; - "XF86AudioPrev".action.spawn = [ - "playerctl" - "previous" - ]; - "Mod+Space".action = actions.toggle-window-floating; - } - (makeDirBind "Mod" "focus-window-$DIR" vBinds) - (makeDirBind "Mod" "focus-column-or-monitor-$DIR" hBinds) - (makeDirBind "Mod+Shift" "move-column-$DIR-or-to-monitor-$DIR" hBinds) - (makeDirBind "Mod+Ctrl" "consume-or-expel-window-$DIR" hBinds) - (makeDirBind "Mod+Ctrl" "move-window-$DIR" vBinds) - (makeTagBind "Mod" "toggle-tag") - (makeTagBind "Mod+Shift" "toggle") - (makeTagBind "Mod+Ctrl" "exclusive-tag") - ]; - outputs = { - # "Unknown-1".enable = false; - "DP-1" = { - transform.rotation = 90; - scale = 1; - }; - "DP-2" = { - variable-refresh-rate = true; - scale = 1; - }; - }; - input = { - warp-mouse-to-focus.enable = true; - }; - cursor = { - hide-after-inactive-ms = 5000; - hide-when-typing = true; - size = 16; - theme = rice.cursor.name; - }; - layout = { - always-center-single-column = true; - gaps = 24; - default-column-width.proportion = 0.5; - preset-column-widths = map (p: { proportion = p; }) [ - (2.0 / 3.0) - 0.5 - (1.0 / 3.0) - ]; - focus-ring = - let - pal = rice.palette.hex; - in - { - active = { - color = pal.bright.yellow; - }; - inactive = { - color = pal.normal.black; - }; - }; - }; - prefer-no-csd = true; - hotkey-overlay.skip-at-startup = true; - window-rules = - let - v = 10.0; - in - [ - { - geometry-corner-radius = { - bottom-left = v; - bottom-right = 0.0; - top-left = 0.0; - top-right = v; - }; - clip-to-geometry = true; - } - ]; - }; - - # programs.ironbar = { - # enable = true; - # systemd = true; - # config = { - # monitors."DP-1" = { - # position = "top"; - # height = 16; - # start = [ - # { - # type = "music"; - # player_type = "mpris"; - # } - # ]; - # center = [ - # { - # type = "focused"; - # icon_size = 16; - # truncate = "middle"; - # } - # ]; - # end = [ - # { type = "clock"; } - # { type = "tray"; } - # ]; - # }; - # }; - # }; - - systemd.user.services.quickshell = { - Unit.PartOf = [ "graphical-session.target" ]; - Unit.After = [ - "graphical-session.target" - "niri.service" - ]; - Install.WantedBy = [ "graphical-session.target" ]; - Service = { - ExecStart = "${lib.getExe' (inputs.quickshell.packages.${pkgs.system}.default.override { - withHyprland = false; - withI3 = false; - }) "qs"}"; - }; - }; - -} diff --git a/home/modules/webapps.nix b/home/modules/webapps.nix deleted file mode 100644 index 637a7b7..0000000 --- a/home/modules/webapps.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, ... }: -{ - imports = [ - ../util/firefox-webapp.nix - ]; - programs.firefox.webapps = { - "Syncthing" = { - url = "http://127.0.0.1:8384"; - extraSettings = config.programs.firefox.profiles.default.settings; - name = "Syncthing"; - icon = ../icons/syncthing.png; - }; - "Open-WebUI" = { - url = "http://127.0.0.1:8088"; - extraSettings = config.programs.firefox.profiles.default.settings; - name = "Open-WebUI"; - icon = ../icons/openwebui.png; - }; - }; -} diff --git a/home/plank.nix b/home/plank.nix deleted file mode 100644 index f3004de..0000000 --- a/home/plank.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - ... -}: -{ - imports = [ - ./home.nix - ]; - - home = { - username = "plank"; - homeDirectory = "/home/plank"; - }; -} diff --git a/home/programs/wlogout.nix b/home/programs/wlogout.nix deleted file mode 100644 index 3721963..0000000 --- a/home/programs/wlogout.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - rice, - pkgs, - ... -}: -let - pal = rice.palette.hex; -in -{ - programs.wlogout = { - enable = true; - package = pkgs.wleave; - layout = builtins.fromJSON (builtins.readFile ../dots/wlogout/layout); - style = - with pal; - (builtins.replaceStrings - [ - "/usr/share/wlogout" - "/etc/wlogout" - "#WINBG" - "#BTNCOL" - "#BTNBG" - "#BTNFOCUSBG" - "#WINLOGO" - ] - [ - "${pkgs.wlogout}/share/wlogout" - "${pkgs.wlogout}/etc/wlogout" - util.bg - bright.yellow - util.bg - normal.black - (builtins.path { - name = "winlogo"; - path = ../icons/winlogo.png; - sha256 = "7c1ff96b553c7a7ca3a7b7cf8efe830ab7feea92355aed288a10ee7347c24108"; - }) - ] - (builtins.readFile ../dots/wlogout/style.css) - ); - }; - # xdg.configFile = { - # "wleave/layout".text = builtins.readFile ../dots/wlogout/layout; - # "wleave/style.css".text = with palette-hex; (builtins.replaceStrings - # [ - # "/usr/share/wlogout" - # "/etc/wlogout" - # "#WINBG" - # "#BTNCOL" - # "#BTNBG" - # "#BTNFOCUSBG" - # "#WINLOGO" - # ] - # [ - # "${pkgs.wleave}/share/wleave" - # "${pkgs.wleave}/etc/wleave" - # util.bg - # bright.yellow - # util.bg - # normal.black - # (builtins.path { - # name = "winlogo"; - # path = ../icons/winlogo.png; - # sha256 = "7c1ff96b553c7a7ca3a7b7cf8efe830ab7feea92355aed288a10ee7347c24108"; - # }) - # ] - # (builtins.readFile ../dots/wlogout/style.css)); - # }; - - home.packages = [ pkgs.wlogout ]; -} diff --git a/home/util/name.nix b/home/util/name.nix deleted file mode 100644 index 18b1386..0000000 --- a/home/util/name.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - mainUser, - ... -}: -{ - config.home = { - username = mainUser; - homeDirectory = "/home/${mainUser}"; - }; -} diff --git a/hosts/adrift/boot.nix b/hosts/adrift/boot.nix new file mode 100644 index 0000000..c883502 --- /dev/null +++ b/hosts/adrift/boot.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + boot.kernelParams = [ + "mitigations=off" + "quiet" + "loglevel=3" + "systemd.show_status=auto" + "rd.udev.log_level=3" + "vt.global_cursor_default=0" + ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ + "iwlwifi" + "kvm-intel" + ]; + boot.loader.systemd-boot.configurationLimit = 2; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/adrift/fs.nix b/hosts/adrift/fs.nix new file mode 100644 index 0000000..70cf455 --- /dev/null +++ b/hosts/adrift/fs.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1C5C-8FF4"; + fsType = "vfat"; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/26389642-cf51-4c58-98e9-1fe491a11bb9"; + fsType = "ext4"; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/a732641d-1233-45a7-8614-53caed60f11b"; } + ]; + +} diff --git a/hosts/adrift/hw.nix b/hosts/adrift/hw.nix new file mode 100644 index 0000000..3720cce --- /dev/null +++ b/hosts/adrift/hw.nix @@ -0,0 +1,5 @@ +{ lib, config, ... }: +{ + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + services.xserver.videoDrivers = [ "i915" ]; +} diff --git a/hosts/adrift/id.nix b/hosts/adrift/id.nix new file mode 100644 index 0000000..d5efea6 --- /dev/null +++ b/hosts/adrift/id.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + networking.hostName = "adrift"; # Define your hostname. + time.timeZone = "Australia/Sydney"; + time.hardwareClockInLocalTime = false; + i18n.defaultLocale = "en_AU.UTF-8"; + i18n.supportedLocales = [ "en_AU.UTF-8/UTF-8" ]; + nixpkgs.system = "x86_64-linux"; +} diff --git a/hosts/adrift/power.nix b/hosts/adrift/power.nix new file mode 100644 index 0000000..0d839be --- /dev/null +++ b/hosts/adrift/power.nix @@ -0,0 +1,6 @@ +{ lib, ... }: +{ + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + services.power-profiles-daemon.enable = false; + services.tlp.enable = true; +} diff --git a/hosts/quiver/boot.nix b/hosts/quiver/boot.nix new file mode 100644 index 0000000..1a91cc6 --- /dev/null +++ b/hosts/quiver/boot.nix @@ -0,0 +1,40 @@ +{ pkgs, ... }: +{ + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usbcore" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.initrd.verbose = false; + boot.kernelModules = [ + "kvm-amd" + "i2c-dev" + ]; + boot.consoleLogLevel = 0; + boot.kernelParams = [ + "mitigations=off" + "preempt=full" + "quiet" + "loglevel=3" + "systemd.show_status=off" + "rd.udev.log_level=3" + "vt.global_cursor_default=0" + ]; + boot.supportedFilesystems = { + ntfs = true; + btrfs = true; + }; + boot.loader.efi.canTouchEfiVariables = true; + boot.plymouth = { + enable = true; + # inherit (rice.plymouth) theme themePackages font; + }; + + boot.loader.limine.extraEntries = '' + /Windows + protocol: efi + path: boot():/EFI/Microsoft/Boot/bootmgfw.efi + ''; +} diff --git a/hosts/quiver/fs.nix b/hosts/quiver/fs.nix new file mode 100644 index 0000000..2b41dbc --- /dev/null +++ b/hosts/quiver/fs.nix @@ -0,0 +1,30 @@ +{ ... }: +{ + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/b993b463-c131-4ef1-9aba-0e3eadaa2f9a"; + fsType = "btrfs"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/6B75-AF9F"; + fsType = "vfat"; + }; + + "/data" = { + device = "/dev/disk/by-uuid/39D4F78C658E8B56"; + fsType = "ntfs"; + options = [ + "rw" + "uid=1000" + "gid=100" + ]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/9c006925-e0e9-4165-bc0c-508ae2d1bfce"; } + ]; + +} diff --git a/hosts/quiver/hw.nix b/hosts/quiver/hw.nix new file mode 100644 index 0000000..3be5935 --- /dev/null +++ b/hosts/quiver/hw.nix @@ -0,0 +1,37 @@ +{ config, ... }: +{ + + security.tpm2.enable = true; + + hardware.cpu.amd.updateMicrocode = true; + services.xserver.videoDrivers = [ "nvidia" ]; + + nixpkgs.config.cudaSupport = true; + + hardware.nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.latest; + modesetting.enable = true; + powerManagement.enable = true; + nvidiaPersistenced = true; + open = false; + }; + + hardware.graphics.enable = true; + hardware.graphics.enable32Bit = true; + + # openrgb no longer recognises the device? + # systemd.services.no-rgb = { + # wantedBy = ["multi-user.target"]; + # description = "rgb led turn-off-er"; + # serviceConfig = { + # Type = "oneshot"; + # ExecStart = ''${pkgs.openrgb}/bin/openrgb -d "HyperX DRAM" -m static -c 000000''; + # After = ["openrgb"]; + # }; + # }; + + # services.hardware.openrgb = { + # enable = true; + # motherboard = "amd"; + # }; +} diff --git a/system/modules/sydney.nix b/hosts/quiver/id.nix similarity index 71% rename from system/modules/sydney.nix rename to hosts/quiver/id.nix index b04dc0d..c783063 100644 --- a/system/modules/sydney.nix +++ b/hosts/quiver/id.nix @@ -1,6 +1,8 @@ _: { + networking.hostName = "quiver"; time.timeZone = "Australia/Sydney"; time.hardwareClockInLocalTime = false; i18n.defaultLocale = "en_AU.UTF-8"; i18n.supportedLocales = [ "en_AU.UTF-8/UTF-8" ]; + nixpkgs.system = "x86_64-linux"; } diff --git a/hosts/quiver/input.nix b/hosts/quiver/input.nix new file mode 100644 index 0000000..c5e6399 --- /dev/null +++ b/hosts/quiver/input.nix @@ -0,0 +1,13 @@ +{ lib, pkgs, ... }: +{ + hardware.ckb-next.enable = true; + + services.libinput.mouse = { + accelProfile = "flat"; + accelSpeed = 0.0; + }; + + hm.quickServices = { + ckb-next = "${lib.getExe pkgs.ckb-next} -c -b"; + }; +} diff --git a/hosts/quiver/llm.nix b/hosts/quiver/llm.nix new file mode 100644 index 0000000..ff90f78 --- /dev/null +++ b/hosts/quiver/llm.nix @@ -0,0 +1,20 @@ +{ inputs, config, ... }: +{ + services.ollama = { + enable = true; + user = "ollama"; + }; + + services.open-webui = { + package = inputs.nixpkgs-stable.legacyPackages.x86_64-linux.open-webui; + enable = true; + port = 8088; + environment = { + DO_NOT_TRACK = "True"; + SCARF_NO_ANALYTICS = "True"; + ANONYMIZED_TELEMETRY = "False"; + WEBUI_AUTH = "False"; + DATABASE_URL = "sqlite:///${config.services.open-webui.stateDir}/newdb.db"; + }; + }; +} diff --git a/hosts/quiver/outputs.nix b/hosts/quiver/outputs.nix new file mode 100644 index 0000000..421e9b5 --- /dev/null +++ b/hosts/quiver/outputs.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + hm.programs.niri.settings.outputs = { + "DP-1" = { + transform.rotation = 90; + scale = 1; + }; + "DP-2" = { + variable-refresh-rate = true; + scale = 1; + }; + }; + +} diff --git a/hosts/quiver/stateversion.nix b/hosts/quiver/stateversion.nix new file mode 100644 index 0000000..aee74e5 --- /dev/null +++ b/hosts/quiver/stateversion.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + system.stateVersion = "22.11"; + hm.home.stateVersion = "22.11"; +} diff --git a/rice/default.nix b/rice/default.nix index 2e6c4ce..57342dd 100644 --- a/rice/default.nix +++ b/rice/default.nix @@ -1,10 +1,13 @@ { + pkgs, + lib, inputs, - system, - nix-rice, }: let - pkgs = inputs.nixpkgs.legacyPackages.${system}; + nix-rice = import "${inputs.nix-rice}/lib.nix" { + inherit lib; + kitty-themes-src = { }; + }; inherit (nix-rice) kitty-themes; inherit (nix-rice.palette) toRGBShortHex toRGBHex; theme = kitty-themes.parseTheme ./pal.conf; diff --git a/system/adrift.nix b/system/adrift.nix deleted file mode 100644 index ef09b22..0000000 --- a/system/adrift.nix +++ /dev/null @@ -1,98 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - imports = [ - ./configuration.nix - ]; - - nix.settings.trusted-users = [ "plank" ]; - programs.nh.flake = "/home/plank/.nix"; - - boot.kernelParams = [ - "mitigations=off" - "quiet" - "loglevel=3" - "systemd.show_status=auto" - "rd.udev.log_level=3" - "vt.global_cursor_default=0" - ]; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "nvme" - "usb_storage" - "sd_mod" - "rtsx_pci_sdmmc" - ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ - "iwlwifi" - "kvm-intel" - ]; - boot.kernelPackages = pkgs.linuxPackages; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/1C5C-8FF4"; - fsType = "vfat"; - }; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/26389642-cf51-4c58-98e9-1fe491a11bb9"; - fsType = "ext4"; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/a732641d-1233-45a7-8614-53caed60f11b"; } - ]; - - boot.loader.systemd-boot.configurationLimit = 2; - boot.loader.efi.canTouchEfiVariables = true; - # boot.plymouth.enable = true; - - networking.useDHCP = lib.mkDefault true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - services.power-profiles-daemon.enable = false; - services.tlp.enable = true; - - environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=5"; - EDITOR = "hx"; - }; - - virtualisation = { - podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; - }; - - services.xserver.videoDrivers = [ "i915" ]; - programs.xwayland.enable = true; - - xdg.portal = { - enable = true; - extraPortals = [ - pkgs.xdg-desktop-portal-gtk - ]; - }; - - environment.systemPackages = builtins.attrValues { - inherit (pkgs) - wl-clipboard - wl-clipboard-x11 - xclip - ; - }; - - networking.hostName = "adrift"; # Define your hostname. - users.users.plank = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - }; -} diff --git a/system/configuration.nix b/system/configuration.nix deleted file mode 100644 index ca8bc14..0000000 --- a/system/configuration.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ - inputs, - lib, - pkgs, - mainUser, - ... -}: -{ - - imports = [ - ./modules/network.nix - ./modules/term.nix - ./modules/bootloader.nix - ./modules/sound.nix - ./modules/sydney.nix - ./modules/docs.nix - ./modules/nix-meta.nix - ./modules/anal-retentive.nix - ./modules/wm.nix - ./modules/culr.nix - ]; - - nix.gc = { - automatic = true; - dates = "daily"; - persistent = true; - options = "--delete-older-than 14d"; - }; - - services.angrr = { - enable = true; - enableNixGcIntegration = true; - period = "2weeks"; - package = inputs.angrr.packages.${pkgs.system}.default; - }; - - hardware.enableRedistributableFirmware = true; - hardware.enableAllFirmware = true; - - boot.tmp.useTmpfs = true; - - # services.udev.extraHwdb = '' - # evdev:atkbd:* - # KEYBOARD_KEY_3a=esc - # ''; - services.xserver.xkb.options = "caps:swapescape"; - # services.xserver.xkb.extraLayouts."swap" = { - # description = "caps swap"; - # languages = [ "eng" ]; - # symbolsFile = pkgs.writeText "keyboard" '' - # xkb_symbols - # { - # include "us(basic)" - - # key {[ Escape ]}; - # } - # ''; - # }; - console.useXkbConfig = true; - services.libinput.enable = true; - - hardware.graphics.enable = true; - hardware.graphics.enable32Bit = true; - - services.udisks2.enable = true; - - # services.flatpak.enable = true; - - security.polkit.enable = true; - - xdg.autostart.enable = true; - xdg.portal.enable = true; - - # services.tailscale.enable = true; - - # TODO - move these to more appropriate places - environment.systemPackages = builtins.attrValues { - inherit (pkgs) - curl - eza - git - ; - }; - - programs.nix-index-database.comma.enable = true; - programs.nix-index.enableZshIntegration = false; - programs.nix-index.enableBashIntegration = false; - - # gnome/freedesktop compat stuff - programs.dconf.enable = true; - services.gvfs.enable = true; - - # give cpuset to user - systemd.services."user@".serviceConfig.Delegate = "memory pids cpu cpuset"; - - systemd.user.extraConfig = "LogLevel=debug"; - - system.nixos.tags = [ "fatcock-xxl" ]; -} diff --git a/system/modules/anal-retentive.nix b/system/modules/anal-retentive.nix deleted file mode 100644 index cf7c868..0000000 --- a/system/modules/anal-retentive.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - pkgs, - lib, - ... -}: -{ - # perlless activations - boot.initrd.systemd.enable = true; - # breaks everything - # system.etc.overlay = { - # enable = lib.mkDefault true; - # mutable = true; - # }; - services.userborn.enable = lib.mkDefault true; - - # misc perl - system.disableInstallerTools = true; - programs.less.lessopen = null; - programs.command-not-found.enable = false; - boot.enableContainers = false; - boot.loader.grub.enable = false; - environment.defaultPackages = lib.mkDefault [ ]; - documentation.info.enable = false; - - # no cppnix .. ? - # system.systemBuilderArgs.disallowedRequisites = [pkgs.nix]; - nix.package = pkgs.lix; - system.tools.nixos-option.enable = false; -} diff --git a/system/modules/culr.nix b/system/modules/culr.nix deleted file mode 100644 index a27758c..0000000 --- a/system/modules/culr.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: { - programs.culr = { - enable = true; - pattern = "rainbow-split"; - }; -} diff --git a/system/modules/network.nix b/system/modules/network.nix deleted file mode 100644 index bd64ddf..0000000 --- a/system/modules/network.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ ... }: -{ - # imports = [ - # ./mullvad.nix - # ]; - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - systemd.services.NetworkManager-wait-online.enable = true; # for some reason nm doesn't enable without this - services.resolved = { - enable = true; - fallbackDns = [ - "103.1.206.179" - "168.138.8.38" - "168.138.12.137" - ]; - dnssec = "false"; - }; - services.mullvad-vpn.enable = true; - # systemd.services.mullvad-daemon.environment.TALPID_NET_CLS_MOUNT_DIR = "/opt/net-cls-v1"; - networking.firewall = { - checkReversePath = "loose"; - }; -} diff --git a/system/modules/nix-meta.nix b/system/modules/nix-meta.nix deleted file mode 100644 index d7a810b..0000000 --- a/system/modules/nix-meta.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - pkgs, - lib, - inputs, - mainUser, - ... -}: -{ - # these settings propagate to home-manager's nixpkgs - nixpkgs = { - config = { - allowUnfree = true; - allowUnfreePredicate = _: true; - cudaSupport = true; - }; - }; - - nix = { - # add flake inputs to our registry to allow global use - registry = lib.mapAttrs (_: value: { flake = value; }) inputs; - settings = { - # trusted-users = ["bolt" "plank"]; - experimental-features = [ - "nix-command" - "flakes" - "pipe-operator" - ]; - substitute = true; - }; - extraOptions = '' - keep-outputs = true - keep-derivations = true - ''; - optimise.automatic = true; - # package = pkgs.lix; - }; - - # services.smooooth = { - # enable = true; - # path = "/home/${mainUser}/.nix"; - # blockers = [ - # "hx" - # { - # nix = "die"; - # } - # ]; - # nixPackage = pkgs.lix; - # }; - - programs.meat = { - enable = true; - flake = "/home/${mainUser}/.nix"; - }; - - environment.systemPackages = builtins.attrValues { - inherit (pkgs) - home-manager - cachix - nixfmt-rfc-style - ; - inherit (inputs.nil.packages.${pkgs.system}) nil; - }; -} diff --git a/system/modules/term.nix b/system/modules/term.nix deleted file mode 100644 index a2193e8..0000000 --- a/system/modules/term.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: -let - inherit (pkgs) fish; -in -{ - programs.fish = { - enable = true; - }; - programs.zoxide = { - enable = true; - enableFishIntegration = true; - }; - environment.systemPackages = [ - fish - ]; - environment.shells = [ fish ]; - users.defaultUserShell = fish; - console = { - font = "Lat2-Terminus16"; - }; -} diff --git a/system/modules/wm.nix b/system/modules/wm.nix deleted file mode 100644 index 63486a8..0000000 --- a/system/modules/wm.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - pkgs, - mainUser, - inputs, - ... -}: -{ - services.greetd = { - enable = true; - restart = false; - settings = - let - session = { - command = "niri-session"; - user = "${mainUser}"; - }; - in - { - default_session = session; - initial_session = session; - }; - }; - programs.niri = { - enable = true; - package = inputs.niri.packages.${pkgs.system}.niri-unstable; - }; - services.niri-tag.enable = true; -} diff --git a/system/quiver.nix b/system/quiver.nix deleted file mode 100644 index 2729271..0000000 --- a/system/quiver.nix +++ /dev/null @@ -1,207 +0,0 @@ -{ - config, - lib, - pkgs, - inputs, - rice, - ... -}: -{ - imports = [ - ./configuration.nix - ]; - - environment = { - arbys.enable = true; - files = { - }; - }; - - services.ollama = { - enable = true; - user = "ollama"; - }; - - system.stateVersion = "22.11"; # Did you read the comment? - - networking.hostName = "quiver"; - - users.users.bolt = { - isNormalUser = true; - extraGroups = [ - "wheel" - "podman" - ]; - }; - - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "usbcore" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.initrd.verbose = false; - boot.kernelModules = [ - "kvm-amd" - "i2c-dev" - ]; - boot.consoleLogLevel = 0; - boot.kernelParams = [ - "mitigations=off" - "preempt=full" - "quiet" - "loglevel=3" - "systemd.show_status=off" - "rd.udev.log_level=3" - "vt.global_cursor_default=0" - ]; - - services.scx = { - enable = true; - scheduler = "scx_bpfland"; - }; - boot.kernelPackages = pkgs.linuxPackages_cachyos; - boot.supportedFilesystems = { - ntfs = true; - btrfs = true; - }; - - boot.loader.efi.canTouchEfiVariables = true; - - boot.plymouth = { - enable = true; - # inherit (rice.plymouth) theme themePackages font; - }; - - security.tpm2.enable = true; - - networking.useDHCP = lib.mkDefault true; - - hardware.cpu.amd.updateMicrocode = true; - - environment.pathsToLink = [ - "/share/xdg-desktop-portal" - "/share/applications" - ]; - environment.sessionVariables = { - NIXOS_OZONE_WL = "1"; - # ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=5"; - GBM_BACKEND = "nvidia-drm"; - NVD_BACKEND = "direct"; - __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - LIBVA_DRIVER_NAME = "nvidia"; - __GL_GSYNC_ALLOWED = "1"; - __GL_VRR_ALLOWED = "1"; - EDITOR = "hx"; - }; - - nix.settings.trusted-users = [ "bolt" ]; - - virtualisation.oci-containers.backend = "podman"; - hardware.nvidia-container-toolkit.enable = true; - virtualisation = { - podman = { - enable = true; - dockerSocket.enable = true; - defaultNetwork.settings.dns_enabled = true; - }; - }; - - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.latest; - modesetting.enable = true; - powerManagement.enable = true; - nvidiaPersistenced = true; - open = false; - }; - programs.xwayland.enable = true; - - # openrgb no longer recognises the device? - # systemd.services.no-rgb = { - # wantedBy = ["multi-user.target"]; - # description = "rgb led turn-off-er"; - # serviceConfig = { - # Type = "oneshot"; - # ExecStart = ''${pkgs.openrgb}/bin/openrgb -d "HyperX DRAM" -m static -c 000000''; - # After = ["openrgb"]; - # }; - # }; - - # services.hardware.openrgb = { - # enable = true; - # motherboard = "amd"; - # }; - - hardware.ckb-next.enable = true; - environment.systemPackages = - builtins.attrValues { - inherit (pkgs) - wl-clipboard - wl-clipboard-x11 - xclip - ; - inherit (pkgs.kdePackages) qtbase qtdeclarative; - } - ++ [ - (inputs.quickshell.packages.${pkgs.system}.default.override { - withHyprland = false; - withI3 = false; - }) - ]; - programs.fuse.userAllowOther = true; - services.libinput.mouse = { - accelProfile = "flat"; - accelSpeed = 0.0; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/b993b463-c131-4ef1-9aba-0e3eadaa2f9a"; - fsType = "btrfs"; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/6B75-AF9F"; - fsType = "vfat"; - }; - - "/data" = { - device = "/dev/disk/by-uuid/39D4F78C658E8B56"; - fsType = "ntfs"; - options = [ - "rw" - "uid=1000" - "gid=100" - ]; - }; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/9c006925-e0e9-4165-bc0c-508ae2d1bfce"; } - ]; - - # networking.nftables.enable = true; - networking.firewall = { - # allowedUDPPorts = [1900]; - # allowedTCPPorts = [8200 2234]; - allowedTCPPorts = [ 2234 ]; - }; - - services.open-webui = { - package = inputs.nixpkgs-stable.legacyPackages.x86_64-linux.open-webui; - enable = true; - port = 8088; - environment = { - DO_NOT_TRACK = "True"; - SCARF_NO_ANALYTICS = "True"; - ANONYMIZED_TELEMETRY = "False"; - WEBUI_AUTH = "False"; - DATABASE_URL = "sqlite:///${config.services.open-webui.stateDir}/newdb.db"; - }; - }; - - # for quickshell - qt.enable = true; -} diff --git a/system/servers/atagen-vps/reflector.nix b/system/servers/atagen-vps/reflector.nix deleted file mode 100644 index 585c07d..0000000 --- a/system/servers/atagen-vps/reflector.nix +++ /dev/null @@ -1,361 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{ - config, - pkgs, - ... -}: -let - wekan-compose = pkgs.fetchurl { - url = "https://github.com/wekan/wekan/raw/v6.68/docker-compose.yml"; - sha256 = "sha256-gLZ8bZZ8ZMo1NGz3ooIgXRH6JuMoEMp+to7lfqAvc6E="; - }; - # wekan-private = pkgs.runCommand "wekan-private" {} '' - # cp ${wekan-compose} $out - # sed -i '/localtime/d' $out - # sed -i '/timezone/d' $out - # sed -i 's/80:8080/7897:8080/g' $out - # sed -i 's/ROOT_URL=.*/ROOT_URL=https:\/\/reflector\.beam\/kanban\//' $out - # ''; - wekan-rhizome = pkgs.runCommand "wekan-rhizome" { } '' - cp ${wekan-compose} $out - sed -i '/localtime/d' $out - sed -i '/timezone/d' $out - sed -i 's/80:8080/7897:8080/g' $out - sed -i 's/ROOT_URL=.*/ROOT_URL=https:\/\/board\.rhizome\.tf\//' $out - ''; -in -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - # ./cachix.nix - # (import (builtins.fetchTarball "https://github.com/jonascarpay/declarative-cachix/archive/master.tar.gz")) - ]; - - # cachix = [ - # "nix-community" - # ]; - - nix.settings.experimental-features = [ - "flakes" - "nix-command" - ]; - # systemd.services.NetworkManager-wait-online.enable = false; - - # Use the GRUB 2 boot loader. - boot.loader.grub.enable = true; - boot.loader.grub.version = 2; - boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only - - networking.hostName = "reflector"; # Define your hostname. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - time.timeZone = "Australia/Sydney"; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.sunshine = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ ]; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDSQC8VgKLzoU5BSynJJuC8BFqAEN8JlSIzsZ2Vg9rfXHM7T4vbWtnxSCSbNw3CEnZCfrdDQTeRum7Uq+gvrcHWd9Aj+rVmubTdud70ybW7T7SlGv3b5TYBhMNbrAz0JIJjLnFMy3/pWids1v6mKW3i7k6Kbq8fSt7jva5Yg5x1jtkUUwvjSZjPg/E/Zl0hAcnx8fWe4foFTcYYsUbfEpp6bxdN2QuVmb17UKnLrMz6JTj88Jd2uYZkeKxGOwk+uwrd0WArY8JIiRi1NcPA3I42aAQfZKxCUY/xmVyRlF+l6K8caD4CZlysms9aXQzBhmPPDIY87AwyRlVK5JsRbaMEBMsffX2xk8DdV+2+9RbztgeXOoYk7WjJX1/+WcxY3RGn8QsUfrGALmrQTRGXgYRbtM/ZJq1m9aP6IvVQeKE1NOpKguXpmokB7JsyKPcWk/PCMVYyXM/qYspc6hRPJgGWiJsayj7myO6X5Ssl9uQnHpNNyrQNY+cx3/boBu2J1sM= bolt@quiver" - ]; - }; - - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - helix - ripgrep - fd - curl - - cachix - headscale - - comma - - woodpecker-agent - woodpecker-server - - # podman - # podman-compose - # shadow - - dufs - ]; - - virtualisation = { - docker.enable = true; - # podman = { - # enable = true; - # dockerCompat = true; - # defaultNetwork.dnsname.enable = true; - # }; - }; - - # services.resolved = { - # enable = true; - # fallbackDns = [ "103.1.206.179" "168.138.8.38" "168.138.12.137" ]; - # dnssec = "false"; - # }; - - services.fail2ban.enable = true; - - services.tailscale.enable = true; - - services.headscale = { - enable = true; - serverUrl = "https://net.atagen.co"; - dns = { - nameservers = [ - "103.1.206.179" - "168.138.8.38" - "168.138.12.137" - ]; - magicDns = true; - }; - }; - - services.syncthing = { - enable = true; - extraOptions = { - gui = { - insecureSkipHostcheck = true; - }; - }; - }; - - services.gitea = { - enable = true; - appName = "atagen gitea"; - domain = "git.atagen.co"; - httpPort = 3033; - settings.server = { - START_SSH_SERVER = true; - SSH_PORT = 6660; - SSH_DOMAIN = "git.atagen.co"; - DISABLE_SSH = false; - }; - rootUrl = "https://git.atagen.co"; - settings.service.DISABLE_REGISTRATION = true; - settings.webhook.ALLOWED_HOST_LIST = "external,loopback"; - }; - - users.users.ci = { - isSystemUser = true; - createHome = true; - group = "ci"; - extraGroups = [ - "docker" - "wheel" - ]; - }; - users.groups.ci = { }; - - users.users.ci-agent = { - isSystemUser = true; - createHome = true; - group = "ci"; - extraGroups = [ - "docker" - "wheel" - ]; - }; - users.groups.ci = { }; - - users.users.dufs = { - isSystemUser = true; - createHome = true; - group = "dufs"; - }; - users.groups.dufs = { }; - - systemd.services.woodpecker-server = { - wantedBy = [ "multi-user.target" ]; - description = "woodpecker CI/CD server"; - serviceConfig = { - Environment = [ - "WOODPECKER_OPEN=true" - "WOODPECKER_ADMIN=atagen" - "WOODPECKER_REPO_OWNERS=rhizome" - "WOODPECKER_HOST=https://ci.atagen.co" - "WOODPECKER_GITEA=true" - "WOODPECKER_GITEA_URL=https://git.atagen.co" - "WOODPECKER_GITEA_CLIENT=1418f1d9-e2ce-4e8f-b8b2-7cf714baa07e" - "WOODPECKER_GITEA_SECRET=gto_chpk65trvfbnrqs4cog62kn7sgmvpizg5wbr4zknb54o4gxlssba" - "WOODPECKER_GITEA_SKIP_VERIFY=true" - "WOODPECKER_AGENT_SECRET=71a0ac7d617aef46fb93811c6e2a300e041a324727df12b4805d5f4e9e1f3326" - "WOODPECKER_DATABASE_DATASOURCE=/var/lib/woodpecker/woodpecker.sqlite" - ]; - Restart = "always"; - ExecStart = "${pkgs.woodpecker-server}/bin/woodpecker-server"; - User = "ci"; - Group = "ci"; - }; - }; - - systemd.services.woodpecker-agent = { - wantedBy = [ "multi-user.target" ]; - description = "woodpecker CI/CD agent"; - serviceConfig = { - Environment = [ - "WOODPECKER_SERVER=localhost:9000" - "WOODPECKER_AGENT_SECRET=71a0ac7d617aef46fb93811c6e2a300e041a324727df12b4805d5f4e9e1f3326" - ]; - Restart = "always"; - ExecStart = "${pkgs.woodpecker-agent}/bin/woodpecker-agent"; - User = "ci-agent"; - }; - }; - - # systemd.services.wekan-private = { - # wantedBy = [ "multi-user.target" ]; - # after = [ "network.target" "docker.service" ]; - # requires = [ "docker.service" ]; - # description = "wekan kanban board"; - # serviceConfig = { - # Restart = "always"; - # User = "root"; - # ExecStart = "${pkgs.docker}/bin/docker compose -f ${wekan-private} up"; - # ExecStop = "${pkgs.docker}/bin/docker compose -f ${wekan-private} down"; - # }; - # }; - - systemd.services.wekan-rhizome = { - wantedBy = [ "multi-user.target" ]; - after = [ - "network.target" - "docker.service" - ]; - requires = [ "docker.service" ]; - description = "wekan kanban board for rhizomers"; - serviceConfig = { - Restart = "always"; - User = "root"; - ExecStart = "${pkgs.docker}/bin/docker compose -f ${wekan-rhizome} up"; - ExecStop = "${pkgs.docker}/bin/docker compose -f ${wekan-rhizome} down"; - }; - }; - - systemd.services.dufs = { - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - description = "dufs webdav server"; - serviceConfig = { - User = "dufs"; - Restart = "always"; - ExecStart = "${pkgs.dufs}/bin/dufs -b 127.0.0.1 -p 8083 /home/dufs/files"; - }; - }; - - # systemd.services.foswiki = { - # wantedBy = [ "multi-user.target" ]; - # after = [ "network.target" "docker.service" ]; - # requires = [ "docker.service" ]; - # description = "foswiki wiki site"; - # serviceConfig = { - # Restart = "always"; - # User = "root"; - # ExecStart = "${pkgs.docker}/bin/docker compose -f ${foswiki-compose} up"; - # ExecStop = "${pkgs.docker}/bin/docker compose -f ${foswiki-compose} down"; - # }; - # }; - - services.caddy = { - enable = true; - virtualHosts = { - "atagen.co" = { - serverAliases = [ "www.atagen.co" ]; - extraConfig = '' - respond "i live.. again" - ''; - }; - - "iced-rs.info".extraConfig = '' - reverse_proxy http://127.0.0.1:8765 - ''; - - "ci.atagen.co".extraConfig = '' - reverse_proxy http://127.0.0.1:8000 - ''; - - # "ci.rhizome.tf".extraConfig = '' - # reverse_proxy http://127.0.0.1:8000 - # ''; - - "git.atagen.co".extraConfig = '' - reverse_proxy http://127.0.0.1:3033 - ''; - - # "git.rhizome.tf".extraConfig = '' - # reverse_proxy http://127.0.0.1:3033 - # ''; - - "board.rhizome.tf".extraConfig = '' - reverse_proxy http://127.0.0.1:7897 - ''; - - "net.atagen.co".extraConfig = '' - reverse_proxy http://127.0.0.1:8080 - ''; - - "reflector.beam".extraConfig = '' - tls /etc/selfsigned/cert.pem /etc/selfsigned/key.pem - - route /sync/* { - uri strip_prefix /sync - reverse_proxy http://127.0.0.1:8384 - } - - route /philez/* { - uri strip_prefix /philez - reverse_proxy http://127.0.0.1:8083 - } - ''; - }; - }; - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - passwordAuthentication = false; - kbdInteractiveAuthentication = false; - permitRootLogin = "no"; - }; - - networking.firewall = { - enable = true; - trustedInterfaces = [ "tailscale0" ]; - checkReversePath = "loose"; - allowedTCPPorts = [ - 80 - 443 - 6660 - ]; - allowedUDPPorts = [ - 80 - 443 - 41641 - 6660 - ]; - }; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - system.copySystemConfiguration = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.11"; # Did you read the comment? -} diff --git a/system/servers/rhizome-vps/configuration.nix b/system/servers/rhizome-vps/configuration.nix deleted file mode 100644 index 7c65bf0..0000000 --- a/system/servers/rhizome-vps/configuration.nix +++ /dev/null @@ -1,295 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running `nixos-help`). -{ - pkgs, - lib, - ... -}: -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - nix.extraOptions = '' - keep-outputs = true - keep-derivations = true - ''; - - environment.pathsToLink = [ "/share/zsh" ]; - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; - - users.users.felix = { - isSystemUser = true; - group = "www"; - extraGroups = [ "docker" ]; - }; - - users.users.spore = { - isSystemUser = true; - home = "/home/spore"; - createHome = true; - useDefaultShell = true; - group = "www"; - extraGroups = [ "docker" ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL9VRcCnmjCyV7DpCm8ir3+xPTbyMDBJhgSkhpmdFL5d spore@server.rhizome.tf" - ]; - }; - - users.groups.www = { - members = [ - "acme" - "felix" - "spore" - ]; - }; - - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only - - networking.hostName = "filament"; # Define your hostname. - time.timeZone = "Australia/Sydney"; - - i18n.defaultLocale = "en_AU.UTF-8"; - - users.users.rhizome = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDSQC8VgKLzoU5BSynJJuC8BFqAEN8JlSIzsZ2Vg9rfXHM7T4vbWtnxSCSbNw3CEnZCfrdDQTeRum7Uq+gvrcHWd9Aj+rVmubTdud70ybW7T7SlGv3b5TYBhMNbrAz0JIJjLnFMy3/pWids1v6mKW3i7k6Kbq8fSt7jva5Yg5x1jtkUUwvjSZjPg/E/Zl0hAcnx8fWe4foFTcYYsUbfEpp6bxdN2QuVmb17UKnLrMz6JTj88Jd2uYZkeKxGOwk+uwrd0WArY8JIiRi1NcPA3I42aAQfZKxCUY/xmVyRlF+l6K8caD4CZlysms9aXQzBhmPPDIY87AwyRlVK5JsRbaMEBMsffX2xk8DdV+2+9RbztgeXOoYk7WjJX1/+WcxY3RGn8QsUfrGALmrQTRGXgYRbtM/ZJq1m9aP6IvVQeKE1NOpKguXpmokB7JsyKPcWk/PCMVYyXM/qYspc6hRPJgGWiJsayj7myO6X5Ssl9uQnHpNNyrQNY+cx3/boBu2J1sM= bolt@quiver" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDW/YjnlHiEf2bV0RapVl+jWEtsNYrbXsaJJhXUkAaf61rsTZ2jpda7FmOVGjyJiOkTNYANoT83YhGxvKt3Ukcx5xG0JhcrilEGKfOR43/QLlXetCh4aFed//CXYNQo8obDovx9A8YamzfZWJo0nhshEAt1aDvNGlyPgHZI3r5vYNB6OpMlaSnr873i5hp6S9dxURoF0FjpdZwTWk5DiYUoZCezs6TfG6PzHbSsB88o4AUNZ6O+h1KD0lITSXH/v/M1zG8fkUzfZHFQoZ6VaIMhIVwLmbybvyb630IIfhx6KUoCWzCRlKBjVOGsQ1xZWEnjPgHB6atX5eNc/L8/bdyZOJ4aE2wSdVNMyriYuiyc3t/RwSvcRpfmzaxWUImDpjH3mxCrDymrZIQQTrNuC6o5O3mz3NCZRcFUZmuZXeYphyrzuNgAfsvHKMd8Fu+PdddSPCHkgYEIRuGD4flaujM8eUHZYqKkpmmiMwKk6jupBscN+1uwBqGQbaR0InXR+4c= custard" - ]; - }; - - users.users.ci = { - isSystemUser = true; - createHome = true; - group = "ci"; - extraGroups = [ "docker" ]; - }; - - users.users.ci-agent = { - isSystemUser = true; - createHome = true; - group = "ci"; - extraGroups = [ "docker" ]; - }; - - users.groups.ci = { }; - - virtualisation = { - docker.enable = true; - # podman = { - # enable = true; - # dockerCompat = true; - # defaultNetwork.settings.dns_enabled = true; - # }; - }; - - services.fail2ban.enable = true; - - services.redis.servers."".enable = true; - - services.gitea = { - enable = true; - appName = "rhizome gitea"; - domain = "git.rhizome.tf"; - httpPort = 3036; - settings.server = { - START_SSH_SERVER = true; - SSH_PORT = 6660; - SSH_DOMAIN = "git.rhizome.tf"; - DISABLE_SSH = false; - }; - rootUrl = "https://git.rhizome.tf"; - settings.service.DISABLE_REGISTRATION = true; - settings.webhook.ALLOWED_HOST_LIST = "external,loopback"; - }; - - # systemd.services.spore = { - # wantedBy = [ "multi-user.target" ]; - # description = "Spore Deployment Tool"; - # serviceConfig = { - # User = "spore"; - # Restart = "on-failure"; - # ExecStart = "${lib.getExe pkgs.spore}"; - - # }; - # }; - - systemd.services.grab-keys = { - description = "Server Key Grabber"; - serviceConfig = { - Type = "oneshot"; - User = "spore"; - Restart = "on-failure"; - ExecStart = "${pkgs.openssh}/bin/scp spore@server.rhizome.tf:/etc/letsencrypt/live/server.rhizome.tf/cert.pem /var/www/server.pem"; - }; - }; - - systemd.timers.grab-keys = { - description = "Server Key Grabber"; - timerConfig = { - Persistent = "yes"; - OnCalendar = "daily"; - Unit = "grab-keys.service"; - }; - }; - - systemd.services.woodpecker-server = { - wantedBy = [ "multi-user.target" ]; - description = "woodpecker CI/CD server"; - serviceConfig = { - Environment = [ - "WOODPECKER_OPEN=true" - "WOODPECKER_ADMIN=dbx" - "WOODPECKER_REPO_OWNERS=rhizome" - "WOODPECKER_HOST=https://ci.rhizome.tf" - "WOODPECKER_GITEA=true" - "WOODPECKER_GITEA_URL=https://git.rhizome.tf" - "WOODPECKER_GITEA_CLIENT=86bb265b-8914-4abd-a3eb-f843fabbd79d" - "WOODPECKER_GITEA_SECRET=gto_474i24aku3vda6wjbumdgfdcjdllclecfplfb4wsz2ibkemhdrwq" - "WOODPECKER_GITEA_SKIP_VERIFY=true" - "WOODPECKER_AGENT_SECRET=71a0ac7d617aef46fb93811c6e2a300e041a324727df12b4805d5f4e9e1f3326" - "WOODPECKER_DATABASE_DATASOURCE=/var/lib/woodpecker/woodpecker.sqlite" - ]; - Restart = "on-failure"; - ExecStart = "${lib.getExe pkgs.woodpecker-server}"; - User = "ci"; - Group = "ci"; - }; - }; - - systemd.services.woodpecker-agent = { - wantedBy = [ "multi-user.target" ]; - description = "woodpecker CI/CD agent"; - serviceConfig = { - Environment = [ - "WOODPECKER_AGENT_SECRET=71a0ac7d617aef46fb93811c6e2a300e041a324727df12b4805d5f4e9e1f3326" - ]; - Restart = "always"; - ExecStart = "${lib.getExe pkgs.woodpecker-agent}"; - User = "ci-agent"; - Group = "ci"; - }; - }; - - systemd.services.felix = { - wantedBy = [ "multi-user.target" ]; - description = "gilles on testing"; - serviceConfig = { - ExecStart = ''${lib.getExe pkgs.docker} run --network host -v /var/lib/acme/rhizome.tf:/var/lib/acme/rhizome.tf --env-file /var/www/felix_env git.rhizome.tf/rhizome/gilles:latest''; - Group = "www"; - User = "felix"; - Restart = "always"; - }; - }; - - services.caddy = { - enable = true; - virtualHosts = { - "rhizome.tf".extraConfig = '' - route /.well-known/acme-challenge/* { - root * /var/www/acme-challenge - file_server - } - root * /var/www/rhizome.tf - file_server - handle_errors { - @404 { - expression {http.error.status_code} == 404 - } - rewrite @404 /404.html - file_server - } - ''; - "git.rhizome.tf".extraConfig = '' - reverse_proxy http://localhost:3036 - ''; - "ci.rhizome.tf".extraConfig = '' - reverse_proxy http://localhost:8000 - ''; - }; - group = "www"; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - kitty - helix - ripgrep - fd - exa - bat - nix-index - comma - alejandra - curl - cachix - git - man-pages - man-pages-posix - rnix-lsp - zellij - zoxide - fzf - btop - ]; - documentation.dev.enable = true; - documentation.man.enable = true; - documentation.enable = true; - programs.nix-index-database.comma.enable = true; - programs.nix-index.enableZshIntegration = false; - programs.nix-index.enableBashIntegration = false; - - services.openssh = { - enable = true; - passwordAuthentication = false; - kbdInteractiveAuthentication = false; - permitRootLogin = "no"; - }; - - networking.firewall.allowedTCPPorts = [ - 22 - 80 - 443 - 5539 - 5559 - 6660 - ]; - networking.firewall.allowedUDPPorts = [ - 443 - 6660 - ]; - - security.acme = { - acceptTerms = true; - defaults.email = "admin@rhizome.tf"; - defaults.group = "www"; - certs."rhizome.tf" = { - webroot = "/var/www/acme-challenge"; - }; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? - - system.activationScripts = { - acls.text = '' - ${pkgs.acl}/bin/setfacl -Rm spore:rx /var/lib/acme/rhizome.tf - ''; - }; -} diff --git a/system/servers/rhizome-vps/flake.nix b/system/servers/rhizome-vps/flake.nix deleted file mode 100644 index 677b59a..0000000 --- a/system/servers/rhizome-vps/flake.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - description = "rhizome dev server"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; - - flake-parts = { - url = "github:hercules-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs"; - }; - - flake-utils.url = "github:numtide/flake-utils"; - - home-manager = { - url = "github:nix-community/home-manager/release-23.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix-index-database = { - url = "github:Mic92/nix-index-database"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = - { - self, - nixpkgs, - home-manager, - nix-index-database, - ... - }@inputs: - let - inherit (self) outputs; - in - rec { - nixosConfigurations = { - "filament" = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs outputs; }; - modules = [ - ./configuration.nix - nix-index-database.nixosModules.nix-index - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.extraSpecialArgs = { inherit inputs outputs; }; - home-manager.users.rhizome.imports = [ ./rhizome.nix ]; - } # hm - ]; # modules - }; # filament - }; - }; # rec -} diff --git a/system/servers/rhizome-vps/hardware-configuration.nix b/system/servers/rhizome-vps/hardware-configuration.nix deleted file mode 100644 index 7564564..0000000 --- a/system/servers/rhizome-vps/hardware-configuration.nix +++ /dev/null @@ -1,38 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ - lib, - ... -}: -{ - imports = [ ]; - - boot.initrd.availableKernelModules = [ - "ata_piix" - "uhci_hcd" - "virtio_pci" - "sr_mod" - "virtio_blk" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/f4889546-f71c-4e3c-ab47-e183a72dc52e"; - fsType = "ext4"; - }; - - swapDevices = [ ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.ens3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - virtualisation.hypervGuest.enable = true; -} diff --git a/system/servers/rhizome-vps/rhizome.nix b/system/servers/rhizome-vps/rhizome.nix deleted file mode 100644 index 72acd99..0000000 --- a/system/servers/rhizome-vps/rhizome.nix +++ /dev/null @@ -1,127 +0,0 @@ -{ - pkgs, - ... -}: -{ - home.packages = with pkgs; [ - lazygit - alejandra - ]; - - home = { - username = "rhizome"; - homeDirectory = "/home/rhizome"; - }; - - programs.direnv = { - enable = true; - nix-direnv = { - enable = true; - }; - }; - - programs.git = { - enable = true; - userName = "rhizome"; - userEmail = "filament@rhizome.tf"; - }; - - programs.fzf = { - enable = true; - enableZshIntegration = true; - }; - - programs.helix = { - enable = true; - settings = { - theme = "base16_terminal"; - editor.lsp.display-messages = true; - }; - }; - - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - enableVteIntegration = true; - autocd = true; - defaultKeymap = "viins"; - initExtra = '' - [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - alias ...='cd ../..' - alias ....='cd ../../..' - alias .....='cd ../../../..' - alias chmox='chmod +x' - alias gs='git status' - alias gcl='git clone' - alias ga='git add' - alias gcb='git checkout -b' - alias gco='git checkout' - alias gl='git pull' - alias gp='git push' - alias gd='git diff' - alias gcam='git commit -am' - alias gcm='git commit -m' - alias gr='git restore' - alias gm='git merge' - alias l='exa -lh --group-directories-first --icons --color=always' - alias la='exa -lha --group-directories-first --icons --color=always' - eval "$(zoxide init zsh)" - ''; - plugins = [ - { - name = "powerlevel10k"; - src = pkgs.zsh-powerlevel10k; - file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - } - { - name = "zsh-vi-mode"; - src = pkgs.zsh-vi-mode; - file = "share/zsh-vi-mode/zsh-vi-mode.zsh"; - } - { - name = "zsh-autopair"; - src = pkgs.zsh-autopair; - file = "share/zsh-autopair/zsh-autopair.zsh"; - } - { - name = "zsh-completions"; - src = pkgs.zsh-completions; - file = "share/zsh-completions/zsh-completions.zsh"; - } - { - name = "zsh-command-time"; - src = pkgs.zsh-command-time; - file = "share/zsh-completions/zsh-command-time.zsh"; - } - { - name = "zsh-autocomplete"; - src = pkgs.zsh-autocomplete; - file = "share/zsh-autocomplete/zsh-autocomplete.zsh"; - } - { - name = "zsh-fast-syntax-highlighting"; - src = pkgs.zsh-fast-syntax-highlighting; - file = "share/zsh-fast-syntax-highlighting/zsh-fast-syntax-highlighting.zsh"; - } - { - name = "zsh-nix-shell"; - src = pkgs.zsh-nix-shell; - file = "share/zsh-nix-shell/zsh-nix-shell.zsh"; - } - { - name = "any-nix-shell"; - src = pkgs.any-nix-shell; - file = "share/any-nix-shell/any-nix-shell.zsh"; - } - { - name = "nix-zsh-completions"; - src = pkgs.nix-zsh-completions; - file = "share/nix-zsh-completions/nix-zsh-completions.zsh"; - } - ]; - }; - - home.stateVersion = "23.05"; -} diff --git a/util/create.nix b/util/create.nix new file mode 100644 index 0000000..a17acfc --- /dev/null +++ b/util/create.nix @@ -0,0 +1,29 @@ +let + inputs = import ./inputs.nix; + inherit (inputs) nixpkgs; + inherit (nixpkgs) lib; + recursivelyImport = import ./recursively-import.nix { inherit lib; }; +in +{ + systems = + definitions: + nixpkgs.lib.mapAttrs ( + name: info: + nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs; + mainUser = info.user; + }; + modules = [ + inputs.home-manager.nixosModules.home-manager + (lib.mkAliasOptionModule [ "hm" ] [ "home-manager" "users" info.user ]) + { + home-manager.extraSpecialArgs = { + inherit inputs; + mainUser = info.user; + }; + } + ] ++ (recursivelyImport info.imports); + } + ) definitions; +} diff --git a/util/get-modules.nix b/util/get-modules.nix deleted file mode 100644 index ce5cdeb..0000000 --- a/util/get-modules.nix +++ /dev/null @@ -1,8 +0,0 @@ -inputs: -let - inherit (inputs.nixpkgs.lib) filterAttrs mapAttrsToList; - inherit (builtins) elem; -in -l: -filterAttrs (_: v: elem v l) inputs -|> mapAttrsToList (n: v: v.nixosModules.${n} or v.nixosModules.default) diff --git a/inputs.nix b/util/inputs.nix similarity index 81% rename from inputs.nix rename to util/inputs.nix index 3d9ffdb..c547536 100644 --- a/inputs.nix +++ b/util/inputs.nix @@ -1,5 +1,5 @@ let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); + lock = builtins.fromJSON (builtins.readFile ../flake.lock); node = lock.nodes.root.inputs.__flake-compat; inherit (lock.nodes.${node}.locked) narHash rev url; flake-compat = builtins.fetchTarball { @@ -7,7 +7,7 @@ let sha256 = narHash; }; flake = import flake-compat { - src = ./.; + src = ../.; copySourceTreeToStore = false; useBuiltinsFetchTree = true; }; diff --git a/util/recursively-import.nix b/util/recursively-import.nix new file mode 100644 index 0000000..92b4fc0 --- /dev/null +++ b/util/recursively-import.nix @@ -0,0 +1,21 @@ +{ lib }: +let + recurseIntoFolders = + elem: + if lib.isPath elem && lib.pathIsDirectory elem then + lib.filesystem.listFilesRecursive elem + else + # If it's not a folder, return it unchanged. This handles single-files and + # literal modules (written with {} syntax) + lib.singleton elem; + + filterNixFiles = + paths: + builtins.filter + # filter the files for `.nix` files. if it's not a file, it can stay. + (path: !builtins.isPath path || lib.hasSuffix ".nix" path) + # Expand any folders into all the files within them. Note that this comes + # BEFORE the filtering that's happening above + (builtins.concatMap recurseIntoFolders paths); +in +filterNixFiles