From cd151029a1cfdc46e02fdd1594b04e3fce916c85 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Thu, 25 Nov 2021 17:18:13 +0100 Subject: [PATCH] Tweaks and added some software --- .gitignore | 1 + flake.lock | 46 +++++++------ flake.nix | 25 ++++--- home-manager/modules/alacritty/default.nix | 2 +- home-manager/modules/dunst/default.nix | 80 ++++++++++++++++++++++ home-manager/modules/fish/default.nix | 12 ++++ home-manager/modules/rofi/power.rasi | 5 +- home-manager/modules/sway/default.nix | 7 +- home-manager/modules/waybar/default.nix | 9 +-- modules/desktop/default.nix | 17 +++-- modules/desktop/horus-ca.pem | 28 ++++++++ modules/gnome/default.nix | 6 ++ overlays/default.nix | 2 + pkgs/lunarvim/default.nix | 37 ++++++++++ pkgs/nix-plugins/default.nix | 24 +++++++ 15 files changed, 257 insertions(+), 44 deletions(-) create mode 100644 home-manager/modules/dunst/default.nix create mode 100644 modules/desktop/horus-ca.pem create mode 100644 pkgs/lunarvim/default.nix create mode 100644 pkgs/nix-plugins/default.nix diff --git a/.gitignore b/.gitignore index 8e4f059..03c0084 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /backup /result +/secrets.nix diff --git a/flake.lock b/flake.lock index ebda8e6..7124058 100644 --- a/flake.lock +++ b/flake.lock @@ -17,7 +17,9 @@ }, "ha-now-playing": { "inputs": { - "naersk": "naersk", + "naersk": [ + "naersk" + ], "nixpkgs": [ "nixpkgs" ], @@ -26,11 +28,11 @@ ] }, "locked": { - "lastModified": 1637523547, - "narHash": "sha256-VIx3kWZ4VSub49NDbZiC0eWNY76+WeEnyHnT/FBPD/4=", + "lastModified": 1637673792, + "narHash": "sha256-4hbA3vng5ARWu/rg62h73bwSJeKeIYOLcTvZ2gxazhk=", "ref": "main", - "rev": "43de89c70b9f68b7d1e50ac303b29e3cfed9f280", - "revCount": 6, + "rev": "dd2894089ae666bdd7fabacf5b7de4dc24ecc7cb", + "revCount": 8, "type": "git", "url": "ssh://git@git.datarift.nl/erwin/ha-now-playing.git" }, @@ -47,11 +49,11 @@ ] }, "locked": { - "lastModified": 1637649415, - "narHash": "sha256-I82k+kFZuezkWPJypuqhqhChFbzDR4jpn89e2Fm2zRo=", + "lastModified": 1637721183, + "narHash": "sha256-4CAKKxrt9l0Hbl57Uypo7ol93Ko+5Yn+7xWWCMUyHQ8=", "owner": "nix-community", "repo": "home-manager", - "rev": "c4c761ba554bc674b0d5a89eb7e9f7a488a8859d", + "rev": "df931a59a5864d6ff0c5d83598135816f8593647", "type": "github" }, "original": { @@ -63,21 +65,19 @@ "naersk": { "inputs": { "nixpkgs": [ - "ha-now-playing", "nixpkgs" ] }, "locked": { - "lastModified": 1636968630, - "narHash": "sha256-/C8OVV8mo9M9MgQprHo4A5bM9waWMsw6PI4hb4DnGaA=", - "owner": "nmattia", + "lastModified": 1637576998, + "narHash": "sha256-bGQ66hh4Dl78T9bd1pqdp6fprHMCkrkeKqED6sDUYqo=", + "owner": "nix-community", "repo": "naersk", - "rev": "55c4c0288ea3f115b5dd73af88052c4712994746", + "rev": "b043f2447a4a761529254f4983cacd94b034a122", "type": "github" }, "original": { - "owner": "nmattia", - "ref": "master", + "owner": "nix-community", "repo": "naersk", "type": "github" } @@ -100,6 +100,9 @@ }, "pamedia": { "inputs": { + "naersk": [ + "naersk" + ], "nixpkgs": [ "nixpkgs" ], @@ -108,18 +111,18 @@ ] }, "locked": { - "lastModified": 1637438696, - "narHash": "sha256-nhr2A0tf5afMIceNkHcRVO1lSeI/Ocu9RBfOXDuvaVE=", + "lastModified": 1637764576, + "narHash": "sha256-IJmGfpuapLcozRpGtgVooSrMVW9vROCLce49Wb9nboo=", "ref": "main", - "rev": "e9005826c19acc110c0e613a4cdba5d95715af61", - "revCount": 5, + "rev": "7c037fef4cdc5933a70694d8c743b5439c8354ea", + "revCount": 4, "type": "git", - "url": "ssh://git@git.datarift.nl/erwin/pamedia.git" + "url": "ssh://git@git.datarift.nl/erwin/pamedia-rs.git" }, "original": { "ref": "main", "type": "git", - "url": "ssh://git@git.datarift.nl/erwin/pamedia.git" + "url": "ssh://git@git.datarift.nl/erwin/pamedia-rs.git" } }, "root": { @@ -127,6 +130,7 @@ "flake-utils": "flake-utils", "ha-now-playing": "ha-now-playing", "home-manager": "home-manager", + "naersk": "naersk", "nixpkgs": "nixpkgs", "pamedia": "pamedia" } diff --git a/flake.nix b/flake.nix index 1849ca2..7b8d536 100644 --- a/flake.nix +++ b/flake.nix @@ -11,16 +11,23 @@ flake-utils.url = "github:numtide/flake-utils"; + naersk = { + url = "github:nix-community/naersk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + ha-now-playing = { url = "git+ssh://git@git.datarift.nl/erwin/ha-now-playing.git?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; inputs.utils.follows = "flake-utils"; + inputs.naersk.follows = "naersk"; }; pamedia = { - url = "git+ssh://git@git.datarift.nl/erwin/pamedia.git?ref=main"; + url = "git+ssh://git@git.datarift.nl/erwin/pamedia-rs.git?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; inputs.utils.follows = "flake-utils"; + inputs.naersk.follows = "naersk"; }; }; @@ -34,16 +41,16 @@ modules = [ { _module.args.inputs = inputs; } { _module.args.self-overlay = self.overlay; } - { _module.args.pamedia-overlay = pamedia.overlay; } - { _module.args.ha-now-playing-overlay = ha-now-playing.overlay; } + { _module.args.pamedia-overlay = pamedia.overlays.${system}; } + { _module.args.ha-now-playing-overlay = ha-now-playing.overlays.${system}; } ({ ... }: { imports = builtins.attrValues self.nixosModules ++ [ { nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; nixpkgs.overlays = [ self.overlay - ha-now-playing.overlay - pamedia.overlay + ha-now-playing.overlays.${system} + pamedia.overlays.${system} ]; } @@ -102,8 +109,8 @@ inherit system; overlays = [ self.overlay - ha-now-playing.overlay - pamedia.overlay + ha-now-playing.overlays.${system} + pamedia.overlays.${system} ]; config = { allowUnsupportedSystem = true; @@ -114,12 +121,12 @@ rec { packages = flake-utils.lib.flattenTree { rofi-wayland = pkgs.rofi-wayland; - # pamedia = pkgs.pamedia; + nix-plugins = pkgs.nix-plugins; }; apps = { rofi-wayland = flake-utils.lib.mkApp { drv = packages.rofi-wayland; }; - # pamedia = flake-utils.lib.mkApp { drv = packages.pamedia; }; + nix-plugins = flake-utils.lib.mkApp { drv = packages.nix-plugins; }; }; } ); diff --git a/home-manager/modules/alacritty/default.nix b/home-manager/modules/alacritty/default.nix index 9490825..060be08 100644 --- a/home-manager/modules/alacritty/default.nix +++ b/home-manager/modules/alacritty/default.nix @@ -21,7 +21,7 @@ in }; font = { normal = { - family = "CaskaydiaCove Nerd Font"; + family = "Iosevka Nerd Font"; style = "Medium"; }; size = 10.0; diff --git a/home-manager/modules/dunst/default.nix b/home-manager/modules/dunst/default.nix new file mode 100644 index 0000000..3d050fa --- /dev/null +++ b/home-manager/modules/dunst/default.nix @@ -0,0 +1,80 @@ +{ pkgs, config, lib, ... }: +with lib; +let + cfg = config.eboskma.programs.dunst; +in +{ + options.eboskma.programs.dunst = { + enable = mkEnableOption "activate dunst"; + }; + + config = mkIf (cfg.enable) { + services.dunst = { + enable = true; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + size = "symbolic"; + }; + + settings = { + global = { + follow = "mouse"; + width = "(10, 500)"; + height = 200; + origin = "top-right"; + offset = "25x25"; + indicate_hidden = "yes"; + shrink = false; + transparency = 15; + notification_limit = 0; + separator_height = 1; + padding = 15; + horizontal_padding = 20; + frame_width = 0; + frame_color = "#282a36"; + separator_color = "frame"; + sort = "yes"; + idle_threshold = 120; + font = "Iosevka Nerd Font 10"; + line_height = 0; + markup = "full"; + format = "%s %p\\n%b"; + alignment = "left"; + vertical_alignment = "center"; + show_age_threshold = 60; + word_wrap = "yes"; + ellipsize = "middle"; + ignore_newline = "no"; + stack_duplicates = true; + hide_duplicate_count = false; + show_indicators = "yes"; + icon_position = "left"; + min_icon_size = 64; + max_icon_size = 64; + sticky_history = "yes"; + history_length = 20; + corner_radius = 5; + }; + experimental = { + per_monitor_dpi = false; + }; + urgency_low = { + background = "#282a36"; + foreground = "#6272a4"; + timeout = 3; + }; + urgency_normal = { + background = "#282a36"; + foreground = "#bd93f9"; + timeout = 3; + }; + urgency_high = { + background = "#ff5555"; + foreground = "#f8f8f2"; + timeout = 0; + }; + }; + }; + }; +} diff --git a/home-manager/modules/fish/default.nix b/home-manager/modules/fish/default.nix index c61d653..421434c 100644 --- a/home-manager/modules/fish/default.nix +++ b/home-manager/modules/fish/default.nix @@ -44,11 +44,18 @@ in enableFishIntegration = true; settings = { aws.disabled = true; + + directory.read_only = " "; + + docker_context.symbol = " "; + elixir.symbol = " "; git_branch.symbol = " "; + nix_shell.symbol = " "; memory_usage.symbol = " "; package.symbol = " "; python.symbol = " "; rust.symbol = " "; + time.disabled = false; status = { disabled = false; @@ -77,5 +84,10 @@ in enable = true; nix-direnv.enable = true; }; + + programs.zoxide = { + enable = true; + enableFishIntegration = true; + }; }; } diff --git a/home-manager/modules/rofi/power.rasi b/home-manager/modules/rofi/power.rasi index 910da9e..dcb46a5 100644 --- a/home-manager/modules/rofi/power.rasi +++ b/home-manager/modules/rofi/power.rasi @@ -10,6 +10,7 @@ configuration { text: #efefef; text-alt: #c2c2c2; bg: #333333; + bg-alt: #222222; spacing: 0; background-color: transparent; @@ -30,7 +31,7 @@ window { inputbar { enabled: true; border: 1px; - border-color: @orange; + border-color: @bg-alt; border-radius: 5px; padding: 10px; margin: 0 5px; @@ -68,7 +69,7 @@ element { background-color: @bg; border-radius: 5px; border: 1px; - border-color: @orange; + border-color: @bg-alt; } element-icon { size: 1em; diff --git a/home-manager/modules/sway/default.nix b/home-manager/modules/sway/default.nix index 2f932a1..b380abc 100644 --- a/home-manager/modules/sway/default.nix +++ b/home-manager/modules/sway/default.nix @@ -50,6 +50,7 @@ in input = { "36125:40349:splitKB_Kyria" = { + xkb_layout = "us"; xkb_options = "lv3:ralt_switch"; }; "1133:49291:Logitech_G502_HERO_SE" = { @@ -153,9 +154,9 @@ in "${mod}+Shift+Ctrl+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t \"image/png\" -f"; "${mod}+Shift+Alt+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\""; - # "XF86AudioRaiseVolume" = "exec ${pkgs.pamedia}/bin/pamedia up"; - # "XF86AudioLowerVolume" = "exec ${pkgs.pamedia}/bin/pamedia down"; - # "XF86AudioMute" = "exec ${pkgs.pamedia}/bin/pamedia mute"; + "XF86AudioRaiseVolume" = "exec ${pkgs.pamedia}/bin/pamedia up"; + "XF86AudioLowerVolume" = "exec ${pkgs.pamedia}/bin/pamedia down"; + "XF86AudioMute" = "exec ${pkgs.pamedia}/bin/pamedia mute"; "XF86Calculator" = "exec ${pkgs.gnome.gnome-calculator}/bin/gnome-calculator"; }; diff --git a/home-manager/modules/waybar/default.nix b/home-manager/modules/waybar/default.nix index 1ce6995..6c3c678 100644 --- a/home-manager/modules/waybar/default.nix +++ b/home-manager/modules/waybar/default.nix @@ -2,6 +2,7 @@ with lib; let cfg = config.eboskma.programs.waybar; + token = ""; in { options.eboskma.programs.waybar.enable = mkEnableOption "Enable waybar"; @@ -90,12 +91,12 @@ in # TODO: package as nix thingy "custom/now_playing" = { - exec = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token "; + exec = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token ${token}"; format = " ♪ {}"; interval = 2; - on-click = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token play-pause"; - on-scroll-down = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token volume-up"; - on-scroll-up = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token volume-down"; + on-click = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token ${token} play-pause"; + on-scroll-down = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token ${token} volume-up"; + on-scroll-up = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token ${token} volume-down"; }; "sway/window" = { diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index d140e64..c205847 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -41,6 +41,7 @@ in programs = { alacritty.enable = true; bat.enable = true; + dunst.enable = true; electron = { enable = true; wayland = true; @@ -73,7 +74,9 @@ in jetbrains.clion neovim nomachine-client + pamedia pass + procs ripgrep signal-desktop steam @@ -113,6 +116,7 @@ in } ../../home-manager/modules/alacritty ../../home-manager/modules/bat + ../../home-manager/modules/dunst ../../home-manager/modules/electron ../../home-manager/modules/firefox ../../home-manager/modules/fish @@ -137,6 +141,8 @@ in }; extraPackages = with pkgs; [ swaylock-effects swayidle ]; }; + + steam.enable = true; }; xdg = { @@ -157,10 +163,13 @@ in dbus.packages = [ pkgs.gcr ]; }; - security.pam.services.swaylock = { - text = '' - auth include login - ''; + security = { + pam.services.swaylock = { + text = '' + auth include login + ''; + }; + pki.certificates = [ (builtins.readFile ./horus-ca.pem) ]; }; environment.sessionVariables = { diff --git a/modules/desktop/horus-ca.pem b/modules/desktop/horus-ca.pem new file mode 100644 index 0000000..a237aa1 --- /dev/null +++ b/modules/desktop/horus-ca.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIEzjCCAzagAwIBAgIRALYvLaV5FPil7/QCcCvA7CswDQYJKoZIhvcNAQELBQAw +fzEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50IENBMSowKAYDVQQLDCFlcndp +bkBlcndpbi1wb3Atb3MgKEVyd2luIEJvc2ttYSk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bF6/VCvv9Mk3Uo2J7iLNtgeSWFaEWkQY4wNf0uLNyrsI5LipLQF++Hf8 +Lqrm32YS091rUxpuboGADhdeX4dUWfoVLVB2pRUkr4/1c93d2w9phXGpTFDH+txk +9Gs0THeo8JvmKZ2qru6pyIu+AupblVIeztrmFL27pZP0EWvlpJ1t6qALVEojRixV +PQiDuAD6m38McPXDQY1ckpnmjP/SVJ7Phcta5cLHLSWhrHsX0HswZB7hM4R56APJ +cugN6z4F6VLfDYsFFaC/W/64PT7BiZ9fGl0auWG60KwoZ+HOburg89LDktANM23L +XFao9YymbgfJfmkQtP6WxMTU8dAp2hd1mqHSbfNCib7KWT4ESjgzjWPahbrYFqlu +P3glfoXn9Wyr00zwGNw6pn1qOJN9Id/rZc+u2AF47G3u3g== +-----END CERTIFICATE----- diff --git a/modules/gnome/default.nix b/modules/gnome/default.nix index 71bf175..cad1d80 100644 --- a/modules/gnome/default.nix +++ b/modules/gnome/default.nix @@ -8,10 +8,16 @@ in config = mkIf (cfg.enable) { environment.systemPackages = with pkgs; [ gnomeExtensions.appindicator + papirus-icon-theme ]; services.udev.packages = with pkgs; [ gnome3.gnome-settings-daemon ]; services.gnome.gnome-keyring.enable = true; + + programs = { + evince.enable = true; + file-roller.enable = true; + }; }; } diff --git a/overlays/default.nix b/overlays/default.nix index 982a57a..cee6413 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,5 +1,7 @@ final: prev: { rofi-wayland = prev.pkgs.callPackage ../pkgs/rofi-wayland { }; + nix-plugins = prev.pkgs.callPackage ../pkgs/nix-plugins { }; + lunarvim = prev.pkgs.callPackage ../../pkgs/lunarvim { }; # pamedia = prev.pkgs.callPackage ../pkgs/pamedia { # buildPythonPackage = prev.pkgs.python3.pkgs.buildPythonPackage; # pulsectl = prev.pkgs.python39Packages.pulsectl; diff --git a/pkgs/lunarvim/default.nix b/pkgs/lunarvim/default.nix new file mode 100644 index 0000000..b73d0bc --- /dev/null +++ b/pkgs/lunarvim/default.nix @@ -0,0 +1,37 @@ +{ pkgs, ... }: +with pkgs; +let + nvim-customized = wrapNeovim neovim-unwrapped { }; +in +stdenv.mkDerivation rec { + pname = "lunarvim"; + version = "0.0.1"; + + src = fetchFromGitHub { + owner = "LunarVim"; + repo = "LunarVim"; + rev = "0e531891b1dfd04fa02a22b48ce075120b512277"; + sha256 = "0yfr3vh8p1s9wy21s6bgpp6kp6s9pqlb6k66s76sa22vz4sjiyxb"; + }; + + nativeBuildInputs = [ makeWrapper nvim-customized ]; + buildInputs = [ nvim-customized ]; + + buildPhase = '' + echo "hello" + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + cp -r $(pwd) $out/lvim + export shim="$out/lvim/utils/bin/lvim" + substituteInPlace "$shim" \ + --replace "exec nvim" "exec ${nvim-customized}/bin/nvim" + chmod +x "$shim" + makeWrapper "$shim" "$out/bin/lvim" \ + --set LUNARVIM_RUNTIME_DIR "$out" \ + --prefix PATH : ${lib.makeBinPath [ fzf git ripgrep ]} + runHook postInstall + ''; +} diff --git a/pkgs/nix-plugins/default.nix b/pkgs/nix-plugins/default.nix new file mode 100644 index 0000000..9bced30 --- /dev/null +++ b/pkgs/nix-plugins/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchFromGitHub, nixUnstable, cmake, pkg-config, boost, nlohmann_json }: + +stdenv.mkDerivation rec { + pname = "nix-plugins"; + version = "d0df32b31f3054180741adf5865fd56d6731c572"; + + src = fetchFromGitHub { + owner = "shlevy"; + repo = "nix-plugins"; + rev = version; + sha256 = "sha256-Zbc0iq5ZAr73B+NJvpBHm9GIJhb9qrq0vFmV/ucNT5I="; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = [ nixUnstable boost nlohmann_json ]; + + meta = { + description = "Collection of miscellaneous plugins for the nix expression language"; + homepage = "https://github.com/shlevy/nix-plugins"; + license = lib.licenses.mit; + platforms = lib.platforms.all; + }; +}