diff options
| -rw-r--r-- | home/default.nix | 23 | ||||
| -rw-r--r-- | hosts/c-pc/home.nix | 11 | ||||
| -rw-r--r-- | hosts/copenhagen/home/c.nix | 20 | ||||
| -rw-r--r-- | hosts/phoenix/home.nix | 11 | ||||
| -rw-r--r-- | roles/home/default.nix | 8 | ||||
| -rw-r--r-- | roles/home/desktop/default.nix | 69 | ||||
| -rw-r--r-- | roles/home/desktop/discord.nix (renamed from home/discord.nix) | 4 | ||||
| -rw-r--r-- | roles/home/desktop/eww.nix (renamed from home/eww.nix) | 4 | ||||
| -rw-r--r-- | roles/home/desktop/eww/colors.css | 36 | ||||
| -rw-r--r-- | roles/home/desktop/eww/eww.css (renamed from home/eww/eww.css) | 0 | ||||
| -rw-r--r-- | roles/home/desktop/eww/eww.yuck (renamed from home/eww/eww.yuck) | 0 | ||||
| -rw-r--r-- | roles/home/desktop/eww/windows/music.yuck (renamed from home/eww/windows/music.yuck) | 0 | ||||
| -rw-r--r-- | roles/home/desktop/fastfetch.nix (renamed from home/fastfetch.nix) | 3 | ||||
| -rw-r--r-- | roles/home/desktop/fcitx5.nix (renamed from home/fcitx5.nix) | 4 | ||||
| -rw-r--r-- | roles/home/desktop/flameshot.nix (renamed from home/flameshot.nix) | 2 | ||||
| -rw-r--r-- | roles/home/desktop/gtk.nix (renamed from home/gtk.nix) | 2 | ||||
| -rw-r--r-- | roles/home/desktop/i3.nix (renamed from home/i3.nix) | 4 | ||||
| -rw-r--r-- | roles/home/desktop/kitty.nix (renamed from home/kitty.nix) | 2 | ||||
| -rw-r--r-- | roles/home/desktop/mpv.nix (renamed from home/mpv.nix) | 2 | ||||
| -rw-r--r-- | roles/home/desktop/picom.nix (renamed from home/picom.nix) | 2 | ||||
| -rw-r--r-- | roles/home/desktop/polybar.nix (renamed from home/polybar.nix) | 1 | ||||
| -rw-r--r-- | roles/home/desktop/rofi.nix (renamed from home/rofi.nix) | 2 | ||||
| -rw-r--r-- | roles/home/desktop/theme.nix (renamed from home/theme.nix) | 0 | ||||
| -rw-r--r-- | roles/home/dev/default.nix | 26 | ||||
| -rw-r--r-- | roles/home/dev/git.nix (renamed from home/git.nix) | 6 | ||||
| -rw-r--r-- | roles/home/dev/vim.nix (renamed from home/vim.nix) | 4 | ||||
| -rw-r--r-- | roles/home/dev/vscode.nix (renamed from home/vscode.nix) | 1 |
27 files changed, 175 insertions, 72 deletions
diff --git a/home/default.nix b/home/default.nix deleted file mode 100644 index 6d17ac5..0000000 --- a/home/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ ... }: - -#TODO: properly migrate to a module/role -{ - imports = [ - ./discord.nix - ./eww.nix - ./fastfetch.nix - ./fcitx5.nix - ./flameshot.nix - ./git.nix - ./gtk.nix - ./i3.nix - ./kitty.nix - ./mpv.nix - ./picom.nix - ./polybar.nix - ./rofi.nix - ./theme.nix - ./vim.nix - ./vscode.nix - ]; -} diff --git a/hosts/c-pc/home.nix b/hosts/c-pc/home.nix index 6e87975..3cba16d 100644 --- a/hosts/c-pc/home.nix +++ b/hosts/c-pc/home.nix @@ -4,7 +4,7 @@ imports = [ inputs.impermanence.nixosModules.home-manager.impermanence - ../../home + ../../roles/home ]; # theme.nix is an untracked symlink to a theme under ./themes/ @@ -78,6 +78,15 @@ ]; }; + home.roles = { + dev = { + enable = true; + key = "314C14641E707B68"; + }; + + desktop.enable = true; + }; + programs = { feh.enable = true; btop.enable = true; diff --git a/hosts/copenhagen/home/c.nix b/hosts/copenhagen/home/c.nix index 0d1d5e9..b374712 100644 --- a/hosts/copenhagen/home/c.nix +++ b/hosts/copenhagen/home/c.nix @@ -16,24 +16,12 @@ ]; }; - programs = { - git = { + home.roles = { + dev = { enable = true; - - userName = "Caroline Larimore"; - userEmail = "caroline@larimo.re"; - - signing = { - key = "DE64538967CA0C68"; - signByDefault = true; - }; - - ignores = [ - "*~" - "*.swp" - ]; + key = "DE64538967CA0C68"; }; - }; + } home.packages = with pkgs; [ cloc diff --git a/hosts/phoenix/home.nix b/hosts/phoenix/home.nix index f4911d8..663b8e5 100644 --- a/hosts/phoenix/home.nix +++ b/hosts/phoenix/home.nix @@ -4,7 +4,7 @@ imports = [ inputs.impermanence.nixosModules.home-manager.impermanence - ../../home + ../../roles/home ]; theme = import ../../theme.nix; @@ -60,6 +60,15 @@ ]; }; + home.roles = { + dev = { + enable = true; + key = ""; #TODO: create signing key for phoenix + }; + + desktop.enable = true; + }; + programs = { feh.enable = true; btop.enable = true; diff --git a/roles/home/default.nix b/roles/home/default.nix new file mode 100644 index 0000000..295b1a4 --- /dev/null +++ b/roles/home/default.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + imports = [ + ./desktop + ./dev + ]; +} diff --git a/roles/home/desktop/default.nix b/roles/home/desktop/default.nix new file mode 100644 index 0000000..83192da --- /dev/null +++ b/roles/home/desktop/default.nix @@ -0,0 +1,69 @@ +{ config, pkgs, lib, inputs, ... }: +with lib; + +let cfg = config.home.roles.desktop; in { + imports = [ + ./theme.nix + + ./i3.nix + ./picom.nix + ./polybar.nix + ./rofi.nix + ./kitty.nix + + ./gtk.nix + ./fcitx5.nix + + ./discord.nix + ./eww.nix + ./mpv.nix + ./flameshot.nix + ./fastfetch.nix + ]; + + options.home.roles.desktop = { + enable = mkEnableOption "desktop home role"; + + discord = mkOption { + type = types.bool; + default = true; + }; + eww = mkOption { + type = types.bool; + default = true; + }; + mpv = mkOption { + type = types.bool; + default = true; + }; + screenshot = mkOption { + type = types.bool; + default = true; + }; + fetch = mkOption { + type = types.bool; + default = true; + }; + }; + + config = mkIf cfg.enable { + xsession.windowManager.i3.enable = true; + + gtk.enable = true; + + programs = { + rofi.enable = true; + kitty.enable = true; + + mpv.enable = cfg.mpv; + fastfetch.enable = cfg.fetch; + }; + + services = { + picom.enable = true; + polybar.enable = true; + + flameshot.enable = cfg.screenshot; + }; + }; +} diff --git a/home/discord.nix b/roles/home/desktop/discord.nix index 6050e42..d7c0254 100644 --- a/home/discord.nix +++ b/roles/home/desktop/discord.nix @@ -1,8 +1,8 @@ { config, lib, pkgs, ... }: let - conversion = import ../util/color-conversion.nix { inherit lib; }; -in { + conversion = import ../../../util/color-conversion.nix { inherit lib; }; +in lib.mkIf config.home.roles.desktop.discord { home.packages = with pkgs; [ (discord.override { withVencord = false; diff --git a/home/eww.nix b/roles/home/desktop/eww.nix index 7ed6881..4bfdf63 100644 --- a/home/eww.nix +++ b/roles/home/desktop/eww.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: -{ +lib.mkIf config.home.roles.desktop.eww { home.packages = with pkgs; [ eww @@ -39,7 +39,7 @@ if [[ -f ~/$OUTFILE ]]; then : else - cp ${../assets/album_art_placeholder.png} ~/$OUTFILE + cp ${../../../assets/album_art_placeholder.png} ~/$OUTFILE fi echo ~/$OUTFILE diff --git a/roles/home/desktop/eww/colors.css b/roles/home/desktop/eww/colors.css new file mode 100644 index 0000000..69a3e5e --- /dev/null +++ b/roles/home/desktop/eww/colors.css @@ -0,0 +1,36 @@ +@define-color accent #cc241d; + +@define-color black #282828; +@define-color red #cc241d; +@define-color green #98971a; +@define-color yellow #d79921; +@define-color blue #458588; +@define-color magenta #b16286; +@define-color cyan #689d6a; +@define-color white #a89984; + +@define-color brightBlack #928374; +@define-color brightRed #fb4934; +@define-color brightGreen #b8bb26; +@define-color brightYellow #fabd2f; +@define-color brightBlue #83a598; +@define-color brightMagenta #d3869b; +@define-color brightCyan #8ec07c; +@define-color brightWhite #ebdbb2; + +@define-color bg #282828; +@define-color bg0 #282828; +@define-color bg1 #3c3836; +@define-color bg2 #504945; +@define-color bg3 #665c54; +@define-color bg4 #7c6f64; + +@define-color fg #ebdbb2; +@define-color fg0 #fbf1c7; +@define-color fg1 #ebdbb2; +@define-color fg2 #d5c4a1; +@define-color fg3 #bdae93; +@define-color fg4 #a89984; + +@define-color orange #d65d0e; +@define-color brightOrange #fe8019; diff --git a/home/eww/eww.css b/roles/home/desktop/eww/eww.css index 075beb8..075beb8 100644 --- a/home/eww/eww.css +++ b/roles/home/desktop/eww/eww.css diff --git a/home/eww/eww.yuck b/roles/home/desktop/eww/eww.yuck index 37d2efc..37d2efc 100644 --- a/home/eww/eww.yuck +++ b/roles/home/desktop/eww/eww.yuck diff --git a/home/eww/windows/music.yuck b/roles/home/desktop/eww/windows/music.yuck index 91ee05f..91ee05f 100644 --- a/home/eww/windows/music.yuck +++ b/roles/home/desktop/eww/windows/music.yuck diff --git a/home/fastfetch.nix b/roles/home/desktop/fastfetch.nix index 08c6606..dd8b082 100644 --- a/home/fastfetch.nix +++ b/roles/home/desktop/fastfetch.nix @@ -2,7 +2,6 @@ { programs.fastfetch = { - enable = true; package = (pkgs.fastfetch.overrideAttrs (finalAttrs: previousAttrs: { cmakeFlags = [(lib.cmakeBool "ENABLE_IMAGEMAGICK6" true)]; })); @@ -10,7 +9,7 @@ settings = { logo = { type = "kitty-direct"; - source = "$(ls ${../assets/fastfetch}/*.png | shuf -n 1)"; + source = "$(ls ${../../../assets/fastfetch}/*.png | shuf -n 1)"; width = 36; height = 32; diff --git a/home/fcitx5.nix b/roles/home/desktop/fcitx5.nix index 943bf46..e68312d 100644 --- a/home/fcitx5.nix +++ b/roles/home/desktop/fcitx5.nix @@ -1,7 +1,7 @@ # This file only handles theming of fcitx5. -{ pkgs, config, ... }: +{ lib, pkgs, config, ... }: -{ +lib.mkIf config.home.roles.desktop.enable { xdg.dataFile."fcitx5/themes/nix-theme/theme.conf".source = let c = config.theme.colors; in (pkgs.formats.ini { }).generate "what" { "Metadata" = { Name = "nix-theme"; diff --git a/home/flameshot.nix b/roles/home/desktop/flameshot.nix index d238cec..d7f6e1f 100644 --- a/home/flameshot.nix +++ b/roles/home/desktop/flameshot.nix @@ -2,8 +2,6 @@ { services.flameshot = { - enable = true; - settings = let c = config.theme.colors; in { General = { savePath = "Pictures/Screenshots"; diff --git a/home/gtk.nix b/roles/home/desktop/gtk.nix index c702a8f..33745d5 100644 --- a/home/gtk.nix +++ b/roles/home/desktop/gtk.nix @@ -2,8 +2,6 @@ { gtk = { - enable = true; - theme = { package = pkgs.gruvbox-gtk-theme; name = "Gruvbox-Dark"; diff --git a/home/i3.nix b/roles/home/desktop/i3.nix index 8541cc4..8302a0c 100644 --- a/home/i3.nix +++ b/roles/home/desktop/i3.nix @@ -2,8 +2,6 @@ { xsession.windowManager.i3 = { - enable = true; - config = let #NOTE: Alt (Mod1) and meta (Mod4) have been swapped by keyd. mod = "Mod4"; @@ -98,7 +96,7 @@ { command = "polybar-msg cmd quit"; always = true; notification = false; } { command = "polybar"; always = true; notification = false; } { command = "systemctl --user restart picom"; always = true; notification = false; } - { command = "${pkgs.feh}/bin/feh --bg-fill ${../assets/bg/${config.theme.background}}"; always = true; notification = false; } + { command = "${pkgs.feh}/bin/feh --bg-fill ${../../../assets/bg/${config.theme.background}}"; always = true; notification = false; } { command = "${pkgs.fcitx5}/bin/fcitx5 -r -d"; always = true; notification = false; } { command = "${pkgs.premid}/bin/premid --no-sandbox"; always = false; notification = false; } diff --git a/home/kitty.nix b/roles/home/desktop/kitty.nix index 503f04a..cd373ab 100644 --- a/home/kitty.nix +++ b/roles/home/desktop/kitty.nix @@ -2,8 +2,6 @@ { programs.kitty = { - enable = true; - font = { name = "monospace"; size = 8.0; }; settings = let c = config.theme.colors; in { diff --git a/home/mpv.nix b/roles/home/desktop/mpv.nix index 5e1f013..73a9687 100644 --- a/home/mpv.nix +++ b/roles/home/desktop/mpv.nix @@ -2,8 +2,6 @@ { programs.mpv = { - enable = true; - config = { screenshot-format = "png"; screenshot-template = "~/Pictures/Screenshots/mpv/%F/%P"; diff --git a/home/picom.nix b/roles/home/desktop/picom.nix index 59f6939..cc72333 100644 --- a/home/picom.nix +++ b/roles/home/desktop/picom.nix @@ -2,8 +2,6 @@ { services.picom = { - enable = true; - backend = "glx"; vSync = true; diff --git a/home/polybar.nix b/roles/home/desktop/polybar.nix index f415196..82d9ee1 100644 --- a/home/polybar.nix +++ b/roles/home/desktop/polybar.nix @@ -2,7 +2,6 @@ { services.polybar = { - enable = true; script = "polybar"; package = pkgs.polybar.override { diff --git a/home/rofi.nix b/roles/home/desktop/rofi.nix index d0ff642..dff60e7 100644 --- a/home/rofi.nix +++ b/roles/home/desktop/rofi.nix @@ -2,8 +2,6 @@ { programs.rofi = { - enable = true; - font = "monospace 12"; theme = let diff --git a/home/theme.nix b/roles/home/desktop/theme.nix index 056c8ac..056c8ac 100644 --- a/home/theme.nix +++ b/roles/home/desktop/theme.nix diff --git a/roles/home/dev/default.nix b/roles/home/dev/default.nix new file mode 100644 index 0000000..b092246 --- /dev/null +++ b/roles/home/dev/default.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, inputs, ... }: +with lib; + +let cfg = config.home.roles.dev; in { + imports = [ + ./git.nix + ./vim.nix + ./vscode.nix + ]; + + options.home.roles.dev = { + enable = mkEnableOption "dev home role"; + + key = mkOption { + type = types.str; + description = "git signing key"; + }; + }; + + config = mkIf cfg.enable { + programs = { + git.enable = true; + vscode.enable = config.home.roles.desktop.enable; + }; + }; +} diff --git a/home/git.nix b/roles/home/dev/git.nix index 1d496f0..be67fdb 100644 --- a/home/git.nix +++ b/roles/home/dev/git.nix @@ -1,14 +1,12 @@ -{ ... }: +{ config, ... }: { programs.git = { - enable = true; - userName = "Caroline Larimore"; userEmail = "caroline@larimo.re"; signing = { - key = "314C14641E707B68"; + key = config.home.roles.dev.key; signByDefault = true; }; diff --git a/home/vim.nix b/roles/home/dev/vim.nix index 75e712f..2cb295b 100644 --- a/home/vim.nix +++ b/roles/home/dev/vim.nix @@ -1,10 +1,10 @@ -{ pkgs, ... }: +{ config, lib, pkgs, ... }: # Honestly, I'm pretty disappointed with # home-manager's `programs.vim`. It's kinda bad and # won't let me run `highlight` after `colorscheme` -{ +lib.mkIf config.home.roles.dev.enable { home.file.".vim/vimrc".text = '' set number set relativenumber diff --git a/home/vscode.nix b/roles/home/dev/vscode.nix index 21c0c94..160ad14 100644 --- a/home/vscode.nix +++ b/roles/home/dev/vscode.nix @@ -2,7 +2,6 @@ { programs.vscode = { - enable = true; package = pkgs.vscodium; extensions = with pkgs.vscode-extensions; [ |