diff --git a/base/nix/meat.nix b/base/nix/meat.nix deleted file mode 100644 index 4be7fdf..0000000 --- a/base/nix/meat.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ inputs, mainUser, ... }: -{ - imports = [ - inputs.meat.nixosModules.meat - ]; - programs.meat = { - enable = true; - flake = "/home/${mainUser}/.nix"; - }; -} diff --git a/base/cli.nix b/common/cli.nix similarity index 100% rename from base/cli.nix rename to common/cli.nix diff --git a/base/debloat.nix b/common/debloat.nix similarity index 100% rename from base/debloat.nix rename to common/debloat.nix diff --git a/base/docs.nix b/common/docs.nix similarity index 100% rename from base/docs.nix rename to common/docs.nix diff --git a/base/helix.nix b/common/editor.nix similarity index 99% rename from base/helix.nix rename to common/editor.nix index 8015c0a..abd22ef 100644 --- a/base/helix.nix +++ b/common/editor.nix @@ -1,10 +1,11 @@ { inputs, pkgs, - rice, + config, ... }: let + inherit (config) rice; pal = rice.palette.hex; in { diff --git a/base/network.nix b/common/network.nix similarity index 100% rename from base/network.nix rename to common/network.nix diff --git a/base/nix/gc.nix b/common/nix/gc.nix similarity index 100% rename from base/nix/gc.nix rename to common/nix/gc.nix diff --git a/base/nix/managers.nix b/common/nix/managers.nix similarity index 78% rename from base/nix/managers.nix rename to common/nix/managers.nix index c42886a..2f692a0 100644 --- a/base/nix/managers.nix +++ b/common/nix/managers.nix @@ -1,5 +1,8 @@ -{ mainUser, ... }: +{ inputs, mainUser, ... }: { + imports = [ + inputs.meat.nixosModules.meat + ]; programs.meat = { enable = true; flake = "/home/${mainUser}/.nix"; diff --git a/base/nix/nixpkgs.nix b/common/nix/nixpkgs.nix similarity index 100% rename from base/nix/nixpkgs.nix rename to common/nix/nixpkgs.nix diff --git a/base/nix/settings.nix b/common/nix/settings.nix similarity index 100% rename from base/nix/settings.nix rename to common/nix/settings.nix diff --git a/base/nix/substituters.nix b/common/nix/substituters.nix similarity index 100% rename from base/nix/substituters.nix rename to common/nix/substituters.nix diff --git a/base/nix/tools.nix b/common/nix/tools.nix similarity index 100% rename from base/nix/tools.nix rename to common/nix/tools.nix diff --git a/common/rice/default.nix b/common/rice/default.nix new file mode 100644 index 0000000..a6da9e6 --- /dev/null +++ b/common/rice/default.nix @@ -0,0 +1,55 @@ +{ + lib, + inputs, + ... +}: +let + 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; +in +{ + options.rice = lib.mkOption { + description = "ricing related variables"; + default = { }; + type = lib.types.attrsOf lib.types.anything; + }; + config.rice = rec { + palette = theme // { + normal = { + black = theme.color0; + red = theme.color1; + green = theme.color2; + yellow = theme.color3; + blue = theme.color4; + magenta = theme.color5; + cyan = theme.color6; + white = theme.color7; + }; + bright = { + black = theme.color8; + red = theme.color9; + green = theme.color10; + yellow = theme.color11; + blue = theme.color12; + magenta = theme.color13; + cyan = theme.color14; + white = theme.color15; + }; + util = { + fg = theme.foreground; + bg = theme.background; + fg_sel = theme.selection_foreground; + bg_sel = theme.selection_background; + inherit (theme) cursor; + # url = theme.url_color; + }; + hex = toRGBHex palette; + shortHex = toRGBShortHex palette; + }; + }; +} diff --git a/rice/header.sh b/common/rice/header.sh similarity index 100% rename from rice/header.sh rename to common/rice/header.sh diff --git a/rice/pal.conf b/common/rice/pal.conf similarity index 100% rename from rice/pal.conf rename to common/rice/pal.conf diff --git a/rice/wallpaper.jpg b/common/rice/wallpaper.jpg similarity index 100% rename from rice/wallpaper.jpg rename to common/rice/wallpaper.jpg diff --git a/base/systemd.nix b/common/systemd.nix similarity index 100% rename from base/systemd.nix rename to common/systemd.nix diff --git a/base/terminal.nix b/common/terminal.nix similarity index 96% rename from base/terminal.nix rename to common/terminal.nix index 947a6a2..70a8087 100644 --- a/base/terminal.nix +++ b/common/terminal.nix @@ -1,10 +1,11 @@ { pkgs, - rice, inputs, + config, ... }: let + inherit (config) rice; inherit (pkgs) fish; in { @@ -29,7 +30,7 @@ in "la" = "eza -lg --icons=always --colour=always | culr"; }; interactiveShellInit = '' - ${../rice/header.sh} + ${./rice/header.sh} ''; }; programs.zoxide = { diff --git a/base/users.nix b/common/users.nix similarity index 100% rename from base/users.nix rename to common/users.nix diff --git a/desktop/rice.nix b/desktop/rice.nix deleted file mode 100644 index 244a0c4..0000000 --- a/desktop/rice.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - 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/entry.nix b/entry.nix index ce1b21d..e1b309b 100644 --- a/entry.nix +++ b/entry.nix @@ -6,16 +6,16 @@ in quiver = { user = "bolt"; imports = [ - ./base - ./desktop + ./common + ./graphical ./hosts/quiver ]; }; adrift = { user = "plank"; imports = [ - ./base - ./desktop + ./common + ./graphical ./hosts/adrift ]; }; diff --git a/desktop/audio-control.nix b/graphical/audio-control.nix similarity index 100% rename from desktop/audio-control.nix rename to graphical/audio-control.nix diff --git a/desktop/binds.nix b/graphical/binds.nix similarity index 100% rename from desktop/binds.nix rename to graphical/binds.nix diff --git a/desktop/boot.nix b/graphical/boot.nix similarity index 94% rename from desktop/boot.nix rename to graphical/boot.nix index 4b8baef..2554788 100644 --- a/desktop/boot.nix +++ b/graphical/boot.nix @@ -1,4 +1,7 @@ -{ rice, ... }: +{ config, ... }: +let + inherit (config) rice; +in { boot.tmp.useTmpfs = true; diff --git a/desktop/browser.nix b/graphical/browser.nix similarity index 100% rename from desktop/browser.nix rename to graphical/browser.nix diff --git a/desktop/chat.nix b/graphical/chat.nix similarity index 100% rename from desktop/chat.nix rename to graphical/chat.nix diff --git a/desktop/dev.nix b/graphical/dev.nix similarity index 100% rename from desktop/dev.nix rename to graphical/dev.nix diff --git a/desktop/documents.nix b/graphical/documents.nix similarity index 100% rename from desktop/documents.nix rename to graphical/documents.nix diff --git a/desktop/fm.nix b/graphical/fm.nix similarity index 100% rename from desktop/fm.nix rename to graphical/fm.nix diff --git a/desktop/gfx-env.nix b/graphical/gfx-env.nix similarity index 100% rename from desktop/gfx-env.nix rename to graphical/gfx-env.nix diff --git a/desktop/hw.nix b/graphical/hw.nix similarity index 100% rename from desktop/hw.nix rename to graphical/hw.nix diff --git a/desktop/input.nix b/graphical/input.nix similarity index 100% rename from desktop/input.nix rename to graphical/input.nix diff --git a/desktop/integrations.nix b/graphical/integrations.nix similarity index 100% rename from desktop/integrations.nix rename to graphical/integrations.nix diff --git a/desktop/kernel.nix b/graphical/kernel.nix similarity index 100% rename from desktop/kernel.nix rename to graphical/kernel.nix diff --git a/desktop/logout.nix b/graphical/logout.nix similarity index 96% rename from desktop/logout.nix rename to graphical/logout.nix index d16dfbf..9d82548 100644 --- a/desktop/logout.nix +++ b/graphical/logout.nix @@ -1,9 +1,10 @@ { - rice, pkgs, + config, ... }: let + inherit (config) rice; pal = rice.palette.hex; in { diff --git a/desktop/logout/layout b/graphical/logout/layout similarity index 100% rename from desktop/logout/layout rename to graphical/logout/layout diff --git a/desktop/logout/style.css b/graphical/logout/style.css similarity index 100% rename from desktop/logout/style.css rename to graphical/logout/style.css diff --git a/desktop/media.nix b/graphical/media.nix similarity index 100% rename from desktop/media.nix rename to graphical/media.nix diff --git a/desktop/network.nix b/graphical/network.nix similarity index 100% rename from desktop/network.nix rename to graphical/network.nix diff --git a/desktop/password-manager.nix b/graphical/password-manager.nix similarity index 100% rename from desktop/password-manager.nix rename to graphical/password-manager.nix diff --git a/desktop/platform-themes.nix b/graphical/platform-themes.nix similarity index 89% rename from desktop/platform-themes.nix rename to graphical/platform-themes.nix index 80c99f8..dcba441 100644 --- a/desktop/platform-themes.nix +++ b/graphical/platform-themes.nix @@ -1,4 +1,7 @@ -{ pkgs, rice, ... }: +{ pkgs, config, ... }: +let + inherit (config) rice; +in { # for quickshell qt.enable = true; diff --git a/desktop/quick-services.nix b/graphical/quick-services.nix similarity index 100% rename from desktop/quick-services.nix rename to graphical/quick-services.nix diff --git a/graphical/rice.nix b/graphical/rice.nix new file mode 100644 index 0000000..e85326c --- /dev/null +++ b/graphical/rice.nix @@ -0,0 +1,110 @@ +{ + pkgs, + userPkgs, + config, + inputs, + ... +}: +{ + hm.home.packages = + let + inherit (config.rice) icons fonts cursor; + in + fonts.pkgs + ++ icons.pkgs + ++ [ + cursor.package + ]; + rice = { + fonts = + let + sans = { + name = "Inria Sans"; + size = 12; + package = pkgs.inriafonts; + }; + serif = { + name = "Inria Serif"; + size = 12; + package = pkgs.inriafonts; + }; + monospace = { + name = "Fira Code"; + size = 10; + package = pkgs.fira-code; + }; + emoji = { + name = "Twitter Color Emoji"; + size = 12; + package = pkgs.twemoji-color-font; + }; + in + { + inherit + sans + serif + monospace + emoji + ; + pkgs = [ + sans.package + serif.package + monospace.package + emoji.package + pkgs.meslo-lgs-nf + ]; + }; + + icons = + let + package = pkgs.papirus-icon-theme; + in + { + inherit package; + name = "Papirus-Dark"; + pkgs = [ + package + ]; + }; + + gtk-theme = { + name = "nix-rice"; + package = pkgs.callPackage userPkgs.gtk-theme { palette = config.rice.palette.shortHex; }; + }; + + borders = { + thickness = 6; + rounding = 0; + gaps_in = 32; + gaps_out = 72; + }; + + bg = { + src = + let + name = "wallpaper.jpg"; + in + builtins.path { + inherit name; + path = ./${name}; + sha256 = "2db3f9d0397fbd4746ada297bd14c0c7d3e22c7d4e894968fcfece90bbfb902a"; + }; + }; + + cursor = { + package = pkgs.afterglow-cursors-recolored.override { + themeVariants = [ "Dracula" ]; + draculaColorVariants = [ "Orange" ]; + }; + name = "Afterglow-Recolored-Dracula-Orange"; + }; + + plymouth = { + theme = "starship"; + font = "${config.rice.fonts.sans.package}/share/fonts/truetype/InriaSans-Regular.ttf"; + themePackages = [ + inputs.hudcore.packages.${pkgs.system}.default + ]; + }; + }; +} diff --git a/desktop/shell.nix b/graphical/shell.nix similarity index 94% rename from desktop/shell.nix rename to graphical/shell.nix index 09891da..86bc217 100644 --- a/desktop/shell.nix +++ b/graphical/shell.nix @@ -2,12 +2,13 @@ pkgs, lib, inputs, - rice, mainUser, + config, ... }: let inherit (lib) getExe getExe'; + inherit (config) rice; in { # quickshell stuff @@ -67,7 +68,7 @@ in clobber = true; }; files."/home/${mainUser}/.config/quickshell" = { - source = "/home/${mainUser}/.nix/desktop/quickshell"; + source = "/home/${mainUser}/.nix/graphical/shell/quickshell"; uid = 1000; gid = 100; }; diff --git a/desktop/quickshell/bink/Bink.qml b/graphical/shell/quickshell/bink/Bink.qml similarity index 100% rename from desktop/quickshell/bink/Bink.qml rename to graphical/shell/quickshell/bink/Bink.qml diff --git a/desktop/quickshell/launcher/Launcher.qml b/graphical/shell/quickshell/launcher/Launcher.qml similarity index 100% rename from desktop/quickshell/launcher/Launcher.qml rename to graphical/shell/quickshell/launcher/Launcher.qml diff --git a/desktop/quickshell/noti/Noti.qml b/graphical/shell/quickshell/noti/Noti.qml similarity index 100% rename from desktop/quickshell/noti/Noti.qml rename to graphical/shell/quickshell/noti/Noti.qml diff --git a/desktop/quickshell/particle-test/particle-test.qml b/graphical/shell/quickshell/particle-test/particle-test.qml similarity index 100% rename from desktop/quickshell/particle-test/particle-test.qml rename to graphical/shell/quickshell/particle-test/particle-test.qml diff --git a/desktop/quickshell/rice/Colours.qml b/graphical/shell/quickshell/rice/Colours.qml similarity index 100% rename from desktop/quickshell/rice/Colours.qml rename to graphical/shell/quickshell/rice/Colours.qml diff --git a/desktop/quickshell/shell.qml b/graphical/shell/quickshell/shell.qml similarity index 100% rename from desktop/quickshell/shell.qml rename to graphical/shell/quickshell/shell.qml diff --git a/desktop/quickshell/tags/Tags.qml b/graphical/shell/quickshell/tags/Tags.qml similarity index 100% rename from desktop/quickshell/tags/Tags.qml rename to graphical/shell/quickshell/tags/Tags.qml diff --git a/desktop/quickshell/title/Title.qml b/graphical/shell/quickshell/title/Title.qml similarity index 100% rename from desktop/quickshell/title/Title.qml rename to graphical/shell/quickshell/title/Title.qml diff --git a/desktop/sound.nix b/graphical/sound.nix similarity index 100% rename from desktop/sound.nix rename to graphical/sound.nix diff --git a/desktop/udisks.nix b/graphical/udisks.nix similarity index 100% rename from desktop/udisks.nix rename to graphical/udisks.nix diff --git a/desktop/webapps.nix b/graphical/webapps.nix similarity index 100% rename from desktop/webapps.nix rename to graphical/webapps.nix diff --git a/desktop/webapps/firefox-webapp.nix b/graphical/webapps/firefox-webapp.nix similarity index 100% rename from desktop/webapps/firefox-webapp.nix rename to graphical/webapps/firefox-webapp.nix diff --git a/desktop/webapps/local-webapp.nix b/graphical/webapps/local-webapp.nix similarity index 100% rename from desktop/webapps/local-webapp.nix rename to graphical/webapps/local-webapp.nix diff --git a/desktop/wm.nix b/graphical/wm.nix similarity index 97% rename from desktop/wm.nix rename to graphical/wm.nix index ef59845..8a29c04 100644 --- a/desktop/wm.nix +++ b/graphical/wm.nix @@ -1,10 +1,13 @@ { pkgs, mainUser, - rice, inputs, + config, ... }: +let + inherit (config) rice; +in { imports = [ inputs.niri.nixosModules.niri diff --git a/hosts/quiver/boot.nix b/hosts/quiver/boot.nix index 1a91cc6..710becc 100644 --- a/hosts/quiver/boot.nix +++ b/hosts/quiver/boot.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, ... }: { boot.initrd.availableKernelModules = [ "xhci_pci" @@ -29,7 +29,8 @@ boot.loader.efi.canTouchEfiVariables = true; boot.plymouth = { enable = true; - # inherit (rice.plymouth) theme themePackages font; + # theme needs fixing + # inherit (config.rice.plymouth) theme themePackages font; }; boot.loader.limine.extraEntries = '' diff --git a/rice/gtk-theme.nix b/pkg/gtk-theme.nix similarity index 98% rename from rice/gtk-theme.nix rename to pkg/gtk-theme.nix index 51e3d5f..1ab5d47 100644 --- a/rice/gtk-theme.nix +++ b/pkg/gtk-theme.nix @@ -1,5 +1,4 @@ -{ pkgs }: -{ palette }: +{ pkgs, palette }: let rendersvg = pkgs.runCommand "rendersvg" { } '' mkdir -p $out/bin diff --git a/rice/default.nix b/rice/default.nix deleted file mode 100644 index 57342dd..0000000 --- a/rice/default.nix +++ /dev/null @@ -1,143 +0,0 @@ -{ - pkgs, - lib, - inputs, -}: -let - 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; -in -rec { - palette = theme // { - normal = { - black = theme.color0; - red = theme.color1; - green = theme.color2; - yellow = theme.color3; - blue = theme.color4; - magenta = theme.color5; - cyan = theme.color6; - white = theme.color7; - }; - bright = { - black = theme.color8; - red = theme.color9; - green = theme.color10; - yellow = theme.color11; - blue = theme.color12; - magenta = theme.color13; - cyan = theme.color14; - white = theme.color15; - }; - util = { - fg = theme.foreground; - bg = theme.background; - fg_sel = theme.selection_foreground; - bg_sel = theme.selection_background; - inherit (theme) cursor; - # url = theme.url_color; - }; - hex = toRGBHex palette; - shortHex = toRGBShortHex palette; - }; - - fonts = - let - sans = { - name = "Inria Sans"; - size = 12; - package = pkgs.inriafonts; - }; - serif = { - name = "Inria Serif"; - size = 12; - package = pkgs.inriafonts; - }; - monospace = { - name = "Fira Code"; - size = 10; - package = pkgs.fira-code; - }; - emoji = { - name = "Twitter Color Emoji"; - size = 12; - package = pkgs.twemoji-color-font; - }; - in - { - inherit - sans - serif - monospace - emoji - ; - pkgs = [ - sans.package - serif.package - monospace.package - emoji.package - pkgs.meslo-lgs-nf - ]; - }; - - icons = - let - package = pkgs.papirus-icon-theme; - in - { - inherit package; - name = "Papirus-Dark"; - pkgs = [ - package - ]; - }; - - gtk-theme = { - name = "nix-rice"; - package = pkgs.callPackage ./gtk-theme.nix { } { palette = toRGBShortHex palette; }; - }; - - borders = { - thickness = 6; - rounding = 0; - gaps_in = 32; - gaps_out = 72; - }; - - bg = rec { - src = - let - name = "wallpaper.jpg"; - in - builtins.path { - inherit name; - path = ./${name}; - sha256 = "2db3f9d0397fbd4746ada297bd14c0c7d3e22c7d4e894968fcfece90bbfb902a"; - }; - image = pkgs.callPackage ./wallpaper.nix { } { - palette = toRGBShortHex palette; - wallpaper = src; - }; - }; - - cursor = { - package = pkgs.afterglow-cursors-recolored.override { - themeVariants = [ "Dracula" ]; - draculaColorVariants = [ "Orange" ]; - }; - name = "Afterglow-Recolored-Dracula-Orange"; - }; - - plymouth = { - theme = "starship"; - font = "${fonts.sans.package}/share/fonts/truetype/InriaSans-Regular.ttf"; - themePackages = [ - inputs.hudcore.packages.${pkgs.system}.default - ]; - }; -} diff --git a/rice/wallpaper.nix b/rice/wallpaper.nix deleted file mode 100644 index 905edbe..0000000 --- a/rice/wallpaper.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - pkgs, - lib, - stdenv, - ... -}: -{ - palette, - wallpaper, -}: -let - strPal = - let - inherit (lib) concatStringsSep; - inherit (builtins) foldl' attrValues; - in - concatStringsSep " " ( - foldl' (acc: el: acc ++ (attrValues el)) [ ] [ palette.normal palette.bright palette.util ] - ); -in -stdenv.mkDerivation { - name = "generated-wallpaper.png"; - src = wallpaper; - buildInputs = [ - pkgs.lutgen - ]; - - phases = [ "installPhase" ]; - - installPhase = '' - echo -e "Generating wallpaper from ${wallpaper} using palette:\n${strPal}.." - ${lib.getExe pkgs.lutgen} apply --lum 0.8 -l 10 -s 128 -n 8 -o $out ${wallpaper} -- ${strPal} - ''; -} diff --git a/util/create.nix b/util/create.nix index a17acfc..2c8e43d 100644 --- a/util/create.nix +++ b/util/create.nix @@ -3,6 +3,7 @@ let inherit (inputs) nixpkgs; inherit (nixpkgs) lib; recursivelyImport = import ./recursively-import.nix { inherit lib; }; + recursivePkgs = import ./recursive-pkgs.nix { inherit lib; }; in { systems = @@ -12,6 +13,7 @@ in nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; + userPkgs = recursivePkgs ../pkg; mainUser = info.user; }; modules = [ diff --git a/util/recursive-pkgs.nix b/util/recursive-pkgs.nix new file mode 100644 index 0000000..1b907ac --- /dev/null +++ b/util/recursive-pkgs.nix @@ -0,0 +1,28 @@ +{ lib }: +let + getFiles = + path: + builtins.filter (i: lib.hasSuffix ".nix" (builtins.toString i)) ( + lib.filesystem.listFilesRecursive path + ); + getPkgsAttrs = + path: + let + prefix = builtins.toString path; + in + map ( + file: + let + name = lib.pipe file [ + builtins.toString + (lib.removePrefix (prefix + "/")) + (lib.removeSuffix ".nix") + ]; + in + { + "${name}" = file; + } + ) (getFiles path); + getAllPkgs = path: lib.mergeAttrsList (getPkgsAttrs path); +in +getAllPkgs