From 5dc561da833803aeb1c05351827023e82880475f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Fri, 30 Oct 2020 11:05:26 +0100 Subject: [PATCH] chore: move module/constants.nix to lib/default.nix --- configs/alacritty.nix | 11 ++- configs/default.nix | 45 +-------- configs/dunst.nix | 10 +- configs/flameshot-once.nix | 3 +- configs/fonts.nix | 2 - configs/git.nix | 12 ++- configs/i3.nix | 18 ++-- configs/mail.nix | 12 ++- configs/packages/haskell/default.nix | 10 +- configs/rofi.nix | 6 +- configs/themes/antares.nix | 39 -------- configs/themes/apprentice.nix | 39 -------- configs/themes/connermcd.nix | 39 -------- configs/themes/mac-os.nix | 39 -------- configs/themes/owickstrom-dark.nix | 39 -------- configs/themes/owickstrom.nix | 39 -------- configs/themes/solarized-dark.nix | 39 -------- configs/themes/solarized-light.nix | 39 -------- configs/theming.nix | 7 +- configs/wifi.nix | 2 + lib/colours/antares.nix | 37 ++++++++ lib/colours/apprentice.nix | 37 ++++++++ lib/colours/connermcd.nix | 37 ++++++++ lib/colours/mac-os.nix | 37 ++++++++ lib/colours/owickstrom-dark.nix | 37 ++++++++ lib/colours/owickstrom.nix | 37 ++++++++ lib/colours/solarized-dark.nix | 37 ++++++++ lib/colours/solarized-light.nix | 37 ++++++++ lib/default-applications.nix | 5 + lib/default.nix | 67 +++++++++++--- lib/i3status-rust.nix | 6 +- lib/local-network.nix | 11 +++ modules/constants.nix | 134 --------------------------- modules/system-dependent.nix | 31 +++++++ systems/homeros/configuration.nix | 5 +- systems/toum/configuration.nix | 3 + systems/wilde/configuration.nix | 6 +- 37 files changed, 464 insertions(+), 550 deletions(-) delete mode 100644 configs/themes/antares.nix delete mode 100644 configs/themes/apprentice.nix delete mode 100644 configs/themes/connermcd.nix delete mode 100644 configs/themes/mac-os.nix delete mode 100644 configs/themes/owickstrom-dark.nix delete mode 100644 configs/themes/owickstrom.nix delete mode 100644 configs/themes/solarized-dark.nix delete mode 100644 configs/themes/solarized-light.nix create mode 100644 lib/colours/antares.nix create mode 100644 lib/colours/apprentice.nix create mode 100644 lib/colours/connermcd.nix create mode 100644 lib/colours/mac-os.nix create mode 100644 lib/colours/owickstrom-dark.nix create mode 100644 lib/colours/owickstrom.nix create mode 100644 lib/colours/solarized-dark.nix create mode 100644 lib/colours/solarized-light.nix create mode 100644 lib/default-applications.nix create mode 100644 lib/local-network.nix delete mode 100644 modules/constants.nix create mode 100644 modules/system-dependent.nix diff --git a/configs/alacritty.nix b/configs/alacritty.nix index 53c2f0a..1526f3f 100644 --- a/configs/alacritty.nix +++ b/configs/alacritty.nix @@ -1,18 +1,19 @@ { pkgs, lib, config, ... }: let + inherit (import ) colours; colourNames = [ "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" ]; - colours = lib.getAttrs colourNames config.niveum.colours; + colourPairs = lib.getAttrs colourNames colours; alacrittyConfig = { background_opacity = 0.9; colors = { - primary = { inherit (config.niveum.colours) background foreground; }; - normal = lib.mapAttrs (_: colour: colour.dark) colours; - bright = lib.mapAttrs (_: colour: colour.bright) colours; + primary = { inherit (colours) background foreground; }; + normal = lib.mapAttrs (_: colour: colour.dark) colourPairs; + bright = lib.mapAttrs (_: colour: colour.bright) colourPairs; }; font = { normal.family = "Monospace"; - size = config.niveum.fonts.size - 2; + size = 9; }; key_bindings = [ { diff --git a/configs/default.nix b/configs/default.nix index b809f1e..e3cd56c 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -1,40 +1,14 @@ { pkgs, lib, config, options, ... }: let inherit (lib.strings) makeBinPath; - inherit (import ) localAddresses; + inherit (import ) localAddresses kieran; in { imports = [ - + { boot.supportedFilesystems = [ "ntfs" ]; } - { - niveum.user = { - github = "kmein"; - email = "kmein@posteo.de"; - name = "Kierán Meinhardt"; - }; - - niveum.applications = rec { - fileManager = "$TERMINAL -e ${pkgs.ranger}/bin/ranger"; - }; - - niveum.theme = { - gtk = { - name = "Adwaita-dark"; - package = pkgs.gnome3.gnome-themes-extra; - }; - icon = { - name = "Adwaita"; - package = pkgs.gnome3.adwaita-icon-theme; - }; - cursor = { - name = "capitaine-cursors-white"; - package = pkgs.capitaine-cursors; - }; - }; - } { nix.nixPath = [ "/var/src" @@ -42,18 +16,6 @@ in { ]; } { services.dbus.packages = [ pkgs.gnome3.dconf ]; } - { - environment.systemPackages = [ - (pkgs.writers.writeDashBin "x-www-browser" '' - for browser in $BROWSER firefox chromium google-chrome google-chrome-stable opera vivaldi qupzilla iceweasel konqueror firefox-aurora google-chrome-beta opera-beta vivaldi-beta google-chrome-dev opera-developer vivaldi-snapshot luakit midori epiphany lynx w3m dillo elinks vimb; do - if command -v $browser > /dev/null 2>&1; then - exec $browser "$@" - fi - done - exit 1 - '') - ]; - } { nixpkgs = { config = { @@ -104,7 +66,7 @@ in { users.users.me = { name = "kfm"; - description = config.niveum.user.name; + description = kieran.name; hashedPassword = "$6$w9hXyGFl/.IZBXk$5OiWzS1G.5hImhh1YQmZiCXYNAJhi3X6Y3uSLupJNYYXPLMsQpx2fwF4Xr2uYzGMV8Foqh8TgUavx1APD9rcb/"; isNormalUser = true; @@ -260,7 +222,6 @@ in { ./sshd.nix ./sudo.nix ./sxiv.nix - ./themes/mac-os.nix ./theming.nix ./tmux.nix ./tor.nix diff --git a/configs/dunst.nix b/configs/dunst.nix index 0c39523..040b7fe 100644 --- a/configs/dunst.nix +++ b/configs/dunst.nix @@ -1,12 +1,14 @@ { config, pkgs, ... }: -with config.niveum; { +let + inherit (import ) defaultApplications colours theme; +in { home-manager.users.me.services.dunst = { enable = true; - iconTheme = theme.icon; + iconTheme = (theme pkgs).icon; settings = { global = { transparency = 10; - font = "Sans ${toString fonts.size}"; + font = "Monospace 8"; geometry = "200x5-30+20"; frame_color = colours.foreground; follow = "mouse"; @@ -31,7 +33,7 @@ with config.niveum; { sticky_history = true; history_length = 20; dmenu = "${pkgs.rofi}/bin/rofi -display-run dunst -show run"; - browser = "x-www-browser"; + browser = (defaultApplications pkgs).browser; verbosity = "mesg"; corner_radius = 0; mouse_left_click = "do_action"; diff --git a/configs/flameshot-once.nix b/configs/flameshot-once.nix index d394a8f..910b184 100644 --- a/configs/flameshot-once.nix +++ b/configs/flameshot-once.nix @@ -1,5 +1,6 @@ { lib, pkgs, ... }: let + inherit (import ) defaultApplications; flameshot-once = pkgs.callPackage {}; in { @@ -16,7 +17,7 @@ in { enable = true; createUrl = "http://p.r/image"; deleteUrl = "http://p.r/image/delete/%1"; - xdg-open.browser = "x-www-browser"; + xdg-open.browser = (defaultApplications pkgs).browser; }; config.timeout = 200; }) diff --git a/configs/fonts.nix b/configs/fonts.nix index 45346ad..0ac5ddd 100644 --- a/configs/fonts.nix +++ b/configs/fonts.nix @@ -1,6 +1,4 @@ { pkgs, ... }: { - niveum.fonts.size = 9; - fonts = { enableDefaultFonts = true; enableFontDir = true; diff --git a/configs/git.nix b/configs/git.nix index 6663bd4..da62f9e 100644 --- a/configs/git.nix +++ b/configs/git.nix @@ -1,4 +1,8 @@ -{ pkgs, config, lib, ... }: { +{ pkgs, config, lib, ... }: +let + inherit (import ) kieran ignorePaths; +in +{ environment.systemPackages = [ pkgs.mr pkgs.git @@ -53,8 +57,8 @@ programs.git = { enable = true; package = pkgs.gitAndTools.gitFull; - userName = config.niveum.user.name; - userEmail = config.niveum.user.email; + userName = kieran.name; + userEmail = kieran.email; aliases = { br = "branch"; co = "checkout"; @@ -69,7 +73,7 @@ graph = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"; }; - ignores = config.niveum.ignore; + ignores = ignorePaths; extraConfig = { pull.ff = "only"; core.pager = diff --git a/configs/i3.nix b/configs/i3.nix index 01a6cf4..ecac00f 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -1,5 +1,6 @@ { config, pkgs, lib, ... }: let + inherit (import ) defaultApplications colours; klem = import { inherit pkgs lib; config.scripts = { @@ -59,7 +60,7 @@ let fi ''; -in with config.niveum; { +in { services.xserver = { displayManager.defaultSession = "none+i3"; windowManager.i3 = { @@ -71,7 +72,7 @@ in with config.niveum; { home-manager.users.me.xsession.windowManager.i3 = { enable = true; config = rec { - fonts = [ "Monospace ${toString config.niveum.fonts.size}" ]; + fonts = [ "Monospace 10" ]; modifier = "Mod4"; window = { titlebar = false; @@ -133,7 +134,7 @@ in with config.niveum; { }; bars = [{ workspaceButtons = false; - fonts = [ "Monospace ${toString (config.niveum.fonts.size - 1)}" ]; + fonts = [ "Monospace 8" ]; mode = "hide"; # "dock" position = "bottom"; colors = rec { @@ -148,9 +149,8 @@ in with config.niveum; { }; statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${ pkgs.writeTOML (import { - wifi-interface = networkInterfaces.wireless; - batteryBlock = batteryBlocks.default; - inherit (config.niveum) colours; + inherit (config.niveum) batteryName wirelessInterface; + inherit colours; inherit pkgs; }) }"; @@ -196,10 +196,10 @@ in with config.niveum; { "${modifier}+v" = "split v"; "${modifier}+w" = "layout tabbed"; - "${modifier}+Return" = "exec i3-sensible-terminal"; # "${modifier}+Shift+y" = "exec ${pkgs.qutebrowser}/bin/qutebrowser"; - "${modifier}+t" = "exec ${applications.fileManager}"; - "${modifier}+y" = "exec x-www-browser"; + "${modifier}+Return" = "exec ${(defaultApplications pkgs).terminal}"; + "${modifier}+t" = "exec ${(defaultApplications pkgs).fileManager}"; + "${modifier}+y" = "exec ${(defaultApplications pkgs).browser}"; "${modifier}+Shift+w" = "exec ${pkgs.xautolock}/bin/xautolock -locknow"; "${modifier}+a" = diff --git a/configs/mail.nix b/configs/mail.nix index 4058c14..070dd65 100644 --- a/configs/mail.nix +++ b/configs/mail.nix @@ -1,5 +1,7 @@ { config, pkgs, lib, ... }: let + inherit (import ) kieran; + nixpkgs-much = import (pkgs.fetchFromGitHub { owner = "NixOS"; repo = "nixpkgs"; @@ -145,7 +147,7 @@ in { }; userName = "kieran@fysi.tech"; address = "kieran@fysi.tech"; - realName = config.niveum.user.name; + realName = kieran.name; passwordCommand = pass_ ; }; cock = enableDefaults { @@ -172,7 +174,7 @@ in { primary = false; flavor = "gmail.com"; address = "kieran.meinhardt@gmail.com"; - realName = config.niveum.user.name; + realName = kieran.name; userName = "kieran.meinhardt"; passwordCommand = pass_ ; folders = { @@ -185,7 +187,7 @@ in { primary = false; flavor = "gmail.com"; address = "amroplay@gmail.com"; - realName = config.niveum.user.name; + realName = kieran.name; userName = "amroplay"; passwordCommand = pass_ ; folders = { @@ -210,14 +212,14 @@ in { tls.enable = true; }; address = "kieran.meinhardt@posteo.net"; - realName = config.niveum.user.name; + realName = kieran.name; userName = "kieran.meinhardt@posteo.net"; passwordCommand = pass_ ; }; hu-berlin = enableDefaults { primary = false; address = "meinhark@hu-berlin.de"; - realName = config.niveum.user.name; + realName = kieran.name; userName = "meinhark"; passwordCommand = pass_ ; smtp = { diff --git a/configs/packages/haskell/default.nix b/configs/packages/haskell/default.nix index d1f8b52..c9a3483 100644 --- a/configs/packages/haskell/default.nix +++ b/configs/packages/haskell/default.nix @@ -10,13 +10,13 @@ ''; # :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\"" # :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\"" - ".stack/config.yaml".text = let inherit (config.niveum) user; + ".stack/config.yaml".text = let inherit (import ) kieran; in builtins.toJSON { templates.params = { - author-name = user.name; - author-email = user.email; - copyright = "Copyright: (c) 2019 ${user.name}"; - github-username = user.github; + author-name = kieran.name; + author-email = kieran.email; + copyright = "Copyright: (c) 2020 ${kieran.name}"; + github-username = kieran.github; }; }; }; diff --git a/configs/rofi.nix b/configs/rofi.nix index af556f4..de6dcfa 100644 --- a/configs/rofi.nix +++ b/configs/rofi.nix @@ -1,12 +1,14 @@ { config, ... }: -with config.niveum; { +let + inherit (import ) colours; +in{ home-manager.users.me.programs.rofi = { enable = true; separator = "solid"; scrollbar = false; borderWidth = 0; lines = 5; - font = "Monospace ${toString (fonts.size - 1)}"; + font = "Monospace 10"; colors = rec { window = rec { background = colours.foreground; diff --git a/configs/themes/antares.nix b/configs/themes/antares.nix deleted file mode 100644 index 7602793..0000000 --- a/configs/themes/antares.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = rec { - black = { - bright = "#151515"; - dark = "#000000"; - }; - red = { - bright = "#de575c"; - dark = "#de575c"; - }; - yellow = { - bright = "#ebe971"; - dark = "#ebe971"; - }; - green = { - bright = "#00b853"; - dark = "#00b853"; - }; - blue = { - bright = "#90d0f0"; - dark = "#7fc6f0"; - }; - magenta = { - bright = "#cf9ffa"; - dark = "#cf9ffa"; - }; - cyan = { - bright = "#4ae5e8"; - dark = "#4ae5e8"; - }; - white = { - bright = "#ffffff"; - dark = "#bbbbbb"; - }; - background = black.dark; - foreground = white.dark; - cursor = green.bright; - }; -} diff --git a/configs/themes/apprentice.nix b/configs/themes/apprentice.nix deleted file mode 100644 index de1a416..0000000 --- a/configs/themes/apprentice.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = { - black = { - bright = "#444444"; - dark = "#1c1c1c"; - }; - red = { - bright = "#ff8700"; - dark = "#af5f5f"; - }; - green = { - bright = "#87af87"; - dark = "#5f875f"; - }; - yellow = { - bright = "#ffffaf"; - dark = "#87875f"; - }; - blue = { - bright = "#8fafd7"; - dark = "#5f87af"; - }; - magenta = { - bright = "#8787af"; - dark = "#5f5f87"; - }; - cyan = { - bright = "#5fafaf"; - dark = "#5f8787"; - }; - white = { - bright = "#999999"; - dark = "#6c6c6c"; - }; - background = "#262626"; - foreground = "#bcbcbc"; - cursor = "#bcbcbc"; - }; -} diff --git a/configs/themes/connermcd.nix b/configs/themes/connermcd.nix deleted file mode 100644 index 2984ca6..0000000 --- a/configs/themes/connermcd.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = rec { - black = { - bright = "#454545"; - dark = "#222222"; - }; - red = { - bright = "#FA8072"; - dark = "#B22222"; - }; - green = { - bright = "#779A3E"; - dark = "#556B2F"; - }; - yellow = { - bright = "#DAA520"; - dark = "#B8860B"; - }; - blue = { - bright = "#6495ED"; - dark = "#4682B4"; - }; - magenta = { - bright = "#DA70D6"; - dark = "#9932CC"; - }; - cyan = { - bright = "#B0E0E6"; - dark = "#87CEEB"; - }; - white = { - bright = "#FFFFFF"; - dark = "#C0C0C0"; - }; - background = "#000000"; - foreground = "#AAAAAA"; - cursor = green.bright; - }; -} diff --git a/configs/themes/mac-os.nix b/configs/themes/mac-os.nix deleted file mode 100644 index d6d418a..0000000 --- a/configs/themes/mac-os.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = rec { - black = { - bright = "#818383"; - dark = "#000000"; - }; - red = { - bright = "#fc391f"; - dark = "#c23621"; - }; - yellow = { - bright = "#eaec23"; - dark = "#adad27"; - }; - green = { - bright = "#31e722"; - dark = "#25bc24"; - }; - blue = { - bright = "#5833ff"; - dark = "#492ee1"; - }; - magenta = { - bright = "#f935f8"; - dark = "#d338d3"; - }; - cyan = { - bright = "#14f0f0"; - dark = "#33bbc8"; - }; - white = { - bright = "#e9ebeb"; - dark = "#cbcccd"; - }; - background = black.dark; - foreground = white.dark; - cursor = green.bright; - }; -} diff --git a/configs/themes/owickstrom-dark.nix b/configs/themes/owickstrom-dark.nix deleted file mode 100644 index 4e7cd8e..0000000 --- a/configs/themes/owickstrom-dark.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = rec { - black = { - bright = "#4b4b4b"; - dark = "#242424"; - }; - red = { - bright = "#fc1c18"; - dark = "#d71c15"; - }; - green = { - bright = "#6bc219"; - dark = "#5aa513"; - }; - yellow = { - bright = "#fec80e"; - dark = "#fdb40c"; - }; - blue = { - bright = "#0955ff"; - dark = "#063b8c"; - }; - magenta = { - bright = "#fb0050"; - dark = "#e40038"; - }; - cyan = { - bright = "#3ea8fc"; - dark = "#2595e1"; - }; - white = { - bright = "#8c00ec"; - dark = "#efefef"; - }; - background = "#181818"; - foreground = white.dark; - cursor = "#bbbbbb"; - }; -} diff --git a/configs/themes/owickstrom.nix b/configs/themes/owickstrom.nix deleted file mode 100644 index b525d2c..0000000 --- a/configs/themes/owickstrom.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = rec { - black = { - bright = "#282c34"; - dark = "#282c34"; - }; - red = { - bright = "#e06c75"; - dark = "#e06c75"; - }; - green = { - bright = "#98c379"; - dark = "#98c379"; - }; - yellow = { - bright = "#e5c07b"; - dark = "#e5c07b"; - }; - blue = { - bright = "#61afef"; - dark = "#61afef"; - }; - magenta = { - bright = "#c678dd"; - dark = "#c678dd"; - }; - cyan = { - bright = "#56b6c2"; - dark = "#56b6c2"; - }; - white = { - bright = "#dcdfe4"; - dark = "#dcdfe4"; - }; - background = black.dark; - foreground = white.bright; - cursor = "#a3b3cc"; - }; -} diff --git a/configs/themes/solarized-dark.nix b/configs/themes/solarized-dark.nix deleted file mode 100644 index 413a35e..0000000 --- a/configs/themes/solarized-dark.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = rec { - black = { - dark = "#073642"; - bright = "#002b36"; - }; - red = { - dark = "#dc322f"; - bright = "#cb4b16"; - }; - yellow = { - dark = "#b58900"; - bright = "#657b83"; - }; - green = { - dark = "#859900"; - bright = "#586e75"; - }; - blue = { - dark = "#268bd2"; - bright = "#839496"; - }; - magenta = { - dark = "#d33682"; - bright = "#6c71c4"; - }; - cyan = { - dark = "#2aa198"; - bright = "#93a1a1"; - }; - white = { - dark = "#eee8d5"; - bright = "#fdf6e3"; - }; - background = black.bright; - foreground = blue.bright; - cursor = cyan.bright; - }; -} diff --git a/configs/themes/solarized-light.nix b/configs/themes/solarized-light.nix deleted file mode 100644 index cdd595c..0000000 --- a/configs/themes/solarized-light.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - niveum.colours = rec { - black = { - dark = "#073642"; - bright = "#002b36"; - }; - red = { - dark = "#dc322f"; - bright = "#cb4b16"; - }; - yellow = { - dark = "#b58900"; - bright = "#657b83"; - }; - green = { - dark = "#859900"; - bright = "#586e75"; - }; - blue = { - dark = "#268bd2"; - bright = "#839496"; - }; - magenta = { - dark = "#d33682"; - bright = "#6c71c4"; - }; - cyan = { - dark = "#2aa198"; - bright = "#93a1a1"; - }; - white = { - dark = "#eee8d5"; - bright = "#fdf6e3"; - }; - background = white.bright; - foreground = yellow.bright; - cursor = green.bright; - }; -} diff --git a/configs/theming.nix b/configs/theming.nix index 6c2ea33..55ff483 100644 --- a/configs/theming.nix +++ b/configs/theming.nix @@ -1,8 +1,7 @@ -{ lib, config, ... }: -let inherit (config.niveum) theme colourPalette; +{ lib, config, pkgs, ... }: +let + theme = (import ).theme pkgs; in { - console.colors = map (c: lib.strings.removePrefix "#" c) colourPalette; - environment.systemPackages = [ theme.gtk.package theme.icon.package theme.cursor.package ]; diff --git a/configs/wifi.nix b/configs/wifi.nix index d39c276..f9d890f 100644 --- a/configs/wifi.nix +++ b/configs/wifi.nix @@ -37,6 +37,8 @@ "Born11".psk = "56LMVLbw840EGNWk0RYRqvgicx3FSO"; "FactoryCommunityGuest".psk = "Factory4ever"; "krebs".psk = "aidsballs"; + "b-base".pskRaw = "44040369a63d5bce4576637e8d34aeb3ed3d178011386decb99da473418e9861"; + "c-base".pskRaw = "1355ccb287407bcd0caa4a7a399367c28b1e11bf5da34dd100d4b86ac4cafe46"; }; }; diff --git a/lib/colours/antares.nix b/lib/colours/antares.nix new file mode 100644 index 0000000..3be862b --- /dev/null +++ b/lib/colours/antares.nix @@ -0,0 +1,37 @@ +rec { + black = { + bright = "#151515"; + dark = "#000000"; + }; + red = { + bright = "#de575c"; + dark = "#de575c"; + }; + yellow = { + bright = "#ebe971"; + dark = "#ebe971"; + }; + green = { + bright = "#00b853"; + dark = "#00b853"; + }; + blue = { + bright = "#90d0f0"; + dark = "#7fc6f0"; + }; + magenta = { + bright = "#cf9ffa"; + dark = "#cf9ffa"; + }; + cyan = { + bright = "#4ae5e8"; + dark = "#4ae5e8"; + }; + white = { + bright = "#ffffff"; + dark = "#bbbbbb"; + }; + background = black.dark; + foreground = white.dark; + cursor = green.bright; +} diff --git a/lib/colours/apprentice.nix b/lib/colours/apprentice.nix new file mode 100644 index 0000000..9863b6e --- /dev/null +++ b/lib/colours/apprentice.nix @@ -0,0 +1,37 @@ +{ + black = { + bright = "#444444"; + dark = "#1c1c1c"; + }; + red = { + bright = "#ff8700"; + dark = "#af5f5f"; + }; + green = { + bright = "#87af87"; + dark = "#5f875f"; + }; + yellow = { + bright = "#ffffaf"; + dark = "#87875f"; + }; + blue = { + bright = "#8fafd7"; + dark = "#5f87af"; + }; + magenta = { + bright = "#8787af"; + dark = "#5f5f87"; + }; + cyan = { + bright = "#5fafaf"; + dark = "#5f8787"; + }; + white = { + bright = "#999999"; + dark = "#6c6c6c"; + }; + background = "#262626"; + foreground = "#bcbcbc"; + cursor = "#bcbcbc"; +} diff --git a/lib/colours/connermcd.nix b/lib/colours/connermcd.nix new file mode 100644 index 0000000..d584e55 --- /dev/null +++ b/lib/colours/connermcd.nix @@ -0,0 +1,37 @@ +rec { + black = { + bright = "#454545"; + dark = "#222222"; + }; + red = { + bright = "#FA8072"; + dark = "#B22222"; + }; + green = { + bright = "#779A3E"; + dark = "#556B2F"; + }; + yellow = { + bright = "#DAA520"; + dark = "#B8860B"; + }; + blue = { + bright = "#6495ED"; + dark = "#4682B4"; + }; + magenta = { + bright = "#DA70D6"; + dark = "#9932CC"; + }; + cyan = { + bright = "#B0E0E6"; + dark = "#87CEEB"; + }; + white = { + bright = "#FFFFFF"; + dark = "#C0C0C0"; + }; + background = "#000000"; + foreground = "#AAAAAA"; + cursor = green.bright; +} diff --git a/lib/colours/mac-os.nix b/lib/colours/mac-os.nix new file mode 100644 index 0000000..b9737e6 --- /dev/null +++ b/lib/colours/mac-os.nix @@ -0,0 +1,37 @@ +rec { + black = { + bright = "#818383"; + dark = "#000000"; + }; + red = { + bright = "#fc391f"; + dark = "#c23621"; + }; + yellow = { + bright = "#eaec23"; + dark = "#adad27"; + }; + green = { + bright = "#31e722"; + dark = "#25bc24"; + }; + blue = { + bright = "#5833ff"; + dark = "#492ee1"; + }; + magenta = { + bright = "#f935f8"; + dark = "#d338d3"; + }; + cyan = { + bright = "#14f0f0"; + dark = "#33bbc8"; + }; + white = { + bright = "#e9ebeb"; + dark = "#cbcccd"; + }; + background = black.dark; + foreground = white.dark; + cursor = green.bright; +} diff --git a/lib/colours/owickstrom-dark.nix b/lib/colours/owickstrom-dark.nix new file mode 100644 index 0000000..22ff5e7 --- /dev/null +++ b/lib/colours/owickstrom-dark.nix @@ -0,0 +1,37 @@ +rec { + black = { + bright = "#4b4b4b"; + dark = "#242424"; + }; + red = { + bright = "#fc1c18"; + dark = "#d71c15"; + }; + green = { + bright = "#6bc219"; + dark = "#5aa513"; + }; + yellow = { + bright = "#fec80e"; + dark = "#fdb40c"; + }; + blue = { + bright = "#0955ff"; + dark = "#063b8c"; + }; + magenta = { + bright = "#fb0050"; + dark = "#e40038"; + }; + cyan = { + bright = "#3ea8fc"; + dark = "#2595e1"; + }; + white = { + bright = "#8c00ec"; + dark = "#efefef"; + }; + background = "#181818"; + foreground = white.dark; + cursor = "#bbbbbb"; +} diff --git a/lib/colours/owickstrom.nix b/lib/colours/owickstrom.nix new file mode 100644 index 0000000..59058a7 --- /dev/null +++ b/lib/colours/owickstrom.nix @@ -0,0 +1,37 @@ +rec { + black = { + bright = "#282c34"; + dark = "#282c34"; + }; + red = { + bright = "#e06c75"; + dark = "#e06c75"; + }; + green = { + bright = "#98c379"; + dark = "#98c379"; + }; + yellow = { + bright = "#e5c07b"; + dark = "#e5c07b"; + }; + blue = { + bright = "#61afef"; + dark = "#61afef"; + }; + magenta = { + bright = "#c678dd"; + dark = "#c678dd"; + }; + cyan = { + bright = "#56b6c2"; + dark = "#56b6c2"; + }; + white = { + bright = "#dcdfe4"; + dark = "#dcdfe4"; + }; + background = black.dark; + foreground = white.bright; + cursor = "#a3b3cc"; +} diff --git a/lib/colours/solarized-dark.nix b/lib/colours/solarized-dark.nix new file mode 100644 index 0000000..3007bb9 --- /dev/null +++ b/lib/colours/solarized-dark.nix @@ -0,0 +1,37 @@ +rec { + black = { + dark = "#073642"; + bright = "#002b36"; + }; + red = { + dark = "#dc322f"; + bright = "#cb4b16"; + }; + yellow = { + dark = "#b58900"; + bright = "#657b83"; + }; + green = { + dark = "#859900"; + bright = "#586e75"; + }; + blue = { + dark = "#268bd2"; + bright = "#839496"; + }; + magenta = { + dark = "#d33682"; + bright = "#6c71c4"; + }; + cyan = { + dark = "#2aa198"; + bright = "#93a1a1"; + }; + white = { + dark = "#eee8d5"; + bright = "#fdf6e3"; + }; + background = black.bright; + foreground = blue.bright; + cursor = cyan.bright; +} diff --git a/lib/colours/solarized-light.nix b/lib/colours/solarized-light.nix new file mode 100644 index 0000000..290f960 --- /dev/null +++ b/lib/colours/solarized-light.nix @@ -0,0 +1,37 @@ +rec { + black = { + dark = "#073642"; + bright = "#002b36"; + }; + red = { + dark = "#dc322f"; + bright = "#cb4b16"; + }; + yellow = { + dark = "#b58900"; + bright = "#657b83"; + }; + green = { + dark = "#859900"; + bright = "#586e75"; + }; + blue = { + dark = "#268bd2"; + bright = "#839496"; + }; + magenta = { + dark = "#d33682"; + bright = "#6c71c4"; + }; + cyan = { + dark = "#2aa198"; + bright = "#93a1a1"; + }; + white = { + dark = "#eee8d5"; + bright = "#fdf6e3"; + }; + background = white.bright; + foreground = yellow.bright; + cursor = green.bright; +} diff --git a/lib/default-applications.nix b/lib/default-applications.nix new file mode 100644 index 0000000..00fbd6f --- /dev/null +++ b/lib/default-applications.nix @@ -0,0 +1,5 @@ +pkgs: rec { + terminal = "${pkgs.alacritty}/bin/alacritty"; + browser = "${pkgs.brave}/bin/brave"; + fileManager = "${terminal} -e ${pkgs.ranger}/bin/ranger"; +} diff --git a/lib/default.nix b/lib/default.nix index 1f2c9a7..f7b94e0 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,20 +1,63 @@ { - localAddresses = { - toum = "192.168.178.24"; - zaatar = "192.168.178.21"; - homeros = "192.168.178.22"; - wilde = "192.168.178.32"; - android = "192.168.178.35"; - - tradfri = "192.168.178.28"; - officejet = "192.168.178.27"; - fritzbox = "192.168.178.1"; - }; - nixpkgs-unstable = builtins.fetchGit { url = "https://github.com/NixOS/nixpkgs"; rev = "4512dac960f3833cf24cdbd742b63cb447bbdd9a"; }; sshPort = 22022; + + colours = import ./colours/mac-os.nix; + + theme = pkgs: { + gtk = { + name = "Adwaita-dark"; + package = pkgs.gnome3.gnome-themes-extra; + }; + icon = { + name = "Adwaita"; + package = pkgs.gnome3.adwaita-icon-theme; + }; + cursor = { + name = "capitaine-cursors-white"; + package = pkgs.capitaine-cursors; + }; + }; + + defaultApplications = import ./default-applications.nix; + + localAddresses = import ./local-network.nix; + + kieran = { + github = "kmein"; + email = "kmein@posteo.de"; + name = "Kierán Meinhardt"; + }; + + ignorePaths = [ + "*~" + ".stack-work/" + "__pycache__/" + ".mypy_cache/" + "*.py[co]" + "*.o" + "*.hi" + "*.aux" + "*.bbl" + "*.bcf" + "*.blg" + "*.fdb_latexmk" + "*.fls" + "*.out" + "*.run.xml" + "*.toc" + "*.bbl" + "*.class" + "*.dyn_hi" + "*.dyn_o" + "dist/" + ".envrc" + ".direnv/" + "dist-newstyle/" + ".history" + ]; } diff --git a/lib/i3status-rust.nix b/lib/i3status-rust.nix index 11e11c2..cd2e421 100644 --- a/lib/i3status-rust.nix +++ b/lib/i3status-rust.nix @@ -1,4 +1,4 @@ -{ pkgs, wifi-interface, colours, batteryBlock }: +{ pkgs, wirelessInterface, colours, batteryName }: let inherit (pkgs) lib; @@ -114,7 +114,7 @@ in { } { block = "net"; - device = wifi-interface; + device = wirelessInterface; speed_up = false; speed_down = false; signal_strength = true; @@ -122,7 +122,7 @@ in { } { block = "battery"; - device = batteryBlock; + device = batteryName; } { block = "sound"; diff --git a/lib/local-network.nix b/lib/local-network.nix new file mode 100644 index 0000000..aa93fbf --- /dev/null +++ b/lib/local-network.nix @@ -0,0 +1,11 @@ +{ + toum = "192.168.178.24"; + zaatar = "192.168.178.21"; + homeros = "192.168.178.22"; + wilde = "192.168.178.32"; + android = "192.168.178.35"; + + tradfri = "192.168.178.28"; + officejet = "192.168.178.27"; + fritzbox = "192.168.178.1"; +} diff --git a/modules/constants.nix b/modules/constants.nix deleted file mode 100644 index aa9779b..0000000 --- a/modules/constants.nix +++ /dev/null @@ -1,134 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; -let - colourScheme = config.niveum.colours; - - my-types.hexColour = types.strMatching "#[0-9A-Fa-f]{6}"; - my-types.colourPair = types.submodule { - options = { - dark = mkOption { type = my-types.hexColour; }; - bright = mkOption { type = my-types.hexColour; }; - }; - }; - my-types.theme = types.submodule { - options = { - name = mkOption { type = types.str; }; - package = mkOption { type = types.package; }; - }; - }; - - my-types.colourTheme = types.submodule { - options = { - black = mkOption { type = my-types.colourPair; }; - red = mkOption { type = my-types.colourPair; }; - green = mkOption { type = my-types.colourPair; }; - yellow = mkOption { type = my-types.colourPair; }; - blue = mkOption { type = my-types.colourPair; }; - magenta = mkOption { type = my-types.colourPair; }; - cyan = mkOption { type = my-types.colourPair; }; - white = mkOption { type = my-types.colourPair; }; - background = mkOption { type = my-types.hexColour; }; - foreground = mkOption { type = my-types.hexColour; }; - cursor = mkOption { type = my-types.hexColour; }; - }; - }; -in { - options.niveum = { - applications = { fileManager = mkOption { type = types.str; }; }; - - colours = mkOption { type = my-types.colourTheme; }; - - colourPalette = mkOption { - type = types.listOf my-types.hexColour; - default = with config.niveum.colours; [ - black.dark - red.dark - green.dark - yellow.dark - blue.dark - magenta.dark - cyan.dark - white.dark - black.bright - red.bright - green.bright - yellow.bright - blue.bright - magenta.bright - cyan.bright - white.bright - ]; - }; - - networkInterfaces.wireless = mkOption { type = types.str; }; - - batteryBlocks.default = mkOption { type = types.str; }; - - promptColours = let - colours16 = types.enum [ - "black" - "red" - "green" - "yellow" - "blue" - "magenta" - "cyan" - "white" - ]; - in { - success = mkOption { - type = colours16; - default = "green"; - }; - failure = mkOption { - type = colours16; - default = "red"; - }; - }; - - fonts = { size = mkOption { type = types.int; }; }; - - user = { - github = mkOption { type = types.str; }; - name = mkOption { type = types.str; }; - email = mkOption { type = types.strMatching ".+@.+\\..+"; }; - }; - - ignore = mkOption { - type = types.listOf types.str; - default = [ - "*~" - ".stack-work/" - "__pycache__/" - ".mypy_cache/" - "*.py[co]" - "*.o" - "*.hi" - "*.aux" - "*.bbl" - "*.bcf" - "*.blg" - "*.fdb_latexmk" - "*.fls" - "*.out" - "*.run.xml" - "*.toc" - "*.bbl" - "*.class" - "*.dyn_hi" - "*.dyn_o" - "dist/" - ".envrc" - ".direnv/" - "dist-newstyle/" - ".history" - ]; - }; - - theme = { - gtk = mkOption { type = my-types.theme; }; - icon = mkOption { type = my-types.theme; }; - cursor = mkOption { type = my-types.theme; }; - }; - }; -} diff --git a/modules/system-dependent.nix b/modules/system-dependent.nix new file mode 100644 index 0000000..929d889 --- /dev/null +++ b/modules/system-dependent.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: +with lib; +{ + options.niveum = { + wirelessInterface = mkOption { type = types.str; }; + + batteryName = mkOption { type = types.str; }; + + promptColours = let + colours16 = types.enum [ + "black" + "red" + "green" + "yellow" + "blue" + "magenta" + "cyan" + "white" + ]; + in { + success = mkOption { + type = colours16; + default = "green"; + }; + failure = mkOption { + type = colours16; + default = "red"; + }; + }; + }; +} diff --git a/systems/homeros/configuration.nix b/systems/homeros/configuration.nix index 370aeef..1e37eae 100644 --- a/systems/homeros/configuration.nix +++ b/systems/homeros/configuration.nix @@ -8,10 +8,9 @@ environment.systemPackages = [ pkgs.zeroad pkgs.minecraft ]; niveum = { - batteryBlocks.default = "BAT1"; - networkInterfaces.wireless = "wlp3s0"; + batteryName = "BAT1"; + wirelessInterface = "wlp3s0"; promptColours.success = "green"; - fonts.size = lib.mkForce 11; }; boot.loader.systemd-boot = { diff --git a/systems/toum/configuration.nix b/systems/toum/configuration.nix index c73975d..ebbbb88 100644 --- a/systems/toum/configuration.nix +++ b/systems/toum/configuration.nix @@ -20,6 +20,9 @@ in { + { + services.rss-bridge.enable = true; + } { nixpkgs = { overlays = [ (import ) ]; diff --git a/systems/wilde/configuration.nix b/systems/wilde/configuration.nix index e7dbb79..2516ff9 100644 --- a/systems/wilde/configuration.nix +++ b/systems/wilde/configuration.nix @@ -2,7 +2,7 @@ let inherit (import ) nixpkgs-unstable; unstable = import nixpkgs-unstable { - config.allowUnfree = true; + config.allowUnfree = true; }; in { @@ -29,8 +29,8 @@ in ]; niveum = { - batteryBlocks.default = "BAT0"; - networkInterfaces.wireless = "wlp3s0"; + batteryName = "BAT0"; + wirelessInterface = "wlp3s0"; promptColours.success = "cyan"; };