From e86d916ae81694c4429d93d0473d0005b7572e6c Mon Sep 17 00:00:00 2001 From: reo101 Date: Mon, 13 Mar 2023 18:18:03 +0200 Subject: [PATCH] feat(homix): update configuration Extract `river` configuration into a `home-manager` module Fix `xkb` configuration Unpin `neovim-nightly-overlay`: - https://github.com/nix-community/neovim-nightly-overlay/pull/166 - https://github.com/nix-community/neovim-nightly-overlay/pull/167 --- flake.lock | 30 ++----- flake.nix | 3 +- .../x86_64-linux/homix/configuration.nix | 3 + .../nixos/x86_64-linux/homix/home/reo101.nix | 56 ++++--------- modules/home-manager/default.nix | 1 + modules/home-manager/reo101-river/default.nix | 83 +++++++++++++++++++ .../home-manager/reo101-river}/river | 0 .../home-manager/reo101-river}/wired.ron | 0 .../home-manager/reo101-wezterm/default.nix | 2 +- overlays/default.nix | 11 +++ 10 files changed, 122 insertions(+), 67 deletions(-) create mode 100644 modules/home-manager/reo101-river/default.nix rename {machines/nixos/x86_64-linux/homix/configs => modules/home-manager/reo101-river}/river (100%) rename {machines/nixos/x86_64-linux/homix/configs => modules/home-manager/reo101-river}/wired.ron (100%) diff --git a/flake.lock b/flake.lock index aacf888..a917787 100644 --- a/flake.lock +++ b/flake.lock @@ -272,7 +272,9 @@ "inputs": { "flake-compat": "flake-compat", "neovim-flake": "neovim-flake", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1678090567, @@ -380,16 +382,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1671983799, - "narHash": "sha256-Z2Ro6hFPZHkBqkVXY5/aBUzxi5xizQGvuHQ9+T5B/ks=", + "lastModified": 1677932085, + "narHash": "sha256-+AB4dYllWig8iO6vAiGGYl0NEgmMgGHpy9gzWJ3322g=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fad51abd42ca17a60fc1d4cb9382e2d79ae31836", + "rev": "3c5319ad3aa51551182ac82ea17ab1c6b0f0df89", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -425,22 +427,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1677932085, - "narHash": "sha256-+AB4dYllWig8iO6vAiGGYl0NEgmMgGHpy9gzWJ3322g=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "3c5319ad3aa51551182ac82ea17ab1c6b0f0df89", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nmd": { "flake": false, "locked": { @@ -497,7 +483,7 @@ "nix-colors": "nix-colors", "nix-darwin": "nix-darwin", "nix-on-droid": "nix-on-droid", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "wired": "wired", "zig-overlay": "zig-overlay", "zls-overlay": "zls-overlay" diff --git a/flake.nix b/flake.nix index 8ef8553..6d77471 100644 --- a/flake.nix +++ b/flake.nix @@ -37,8 +37,7 @@ neovim-nightly-overlay = { url = "github:nix-community/neovim-nightly-overlay"; - # inputs.nixpkgs.follows = "nixpkgs"; - inputs.nixpkgs.url = "github:nixos/nixpkgs?rev=fad51abd42ca17a60fc1d4cb9382e2d79ae31836"; + inputs.nixpkgs.follows = "nixpkgs"; }; zig-overlay = { diff --git a/machines/nixos/x86_64-linux/homix/configuration.nix b/machines/nixos/x86_64-linux/homix/configuration.nix index 365e45e..b6451db 100644 --- a/machines/nixos/x86_64-linux/homix/configuration.nix +++ b/machines/nixos/x86_64-linux/homix/configuration.nix @@ -123,6 +123,9 @@ "MOZ_DISABLE_RDD_SANDBOX" = "1"; "EGL_PLATFORM" = "wayland"; "XDG_CURRENT_DESKTOP" = "sway"; # river + "XKB_DEFAULT_LAYOUT" = "us,bg"; + "XKB_DEFAULT_VARIANT" = ",phonetic"; + "XKB_DEFAULT_OPTIONS" = "caps:escape,grp:lalt_lshift_toggle"; }; ### Wayland specific diff --git a/machines/nixos/x86_64-linux/homix/home/reo101.nix b/machines/nixos/x86_64-linux/homix/home/reo101.nix index d23289d..d87cc1e 100644 --- a/machines/nixos/x86_64-linux/homix/home/reo101.nix +++ b/machines/nixos/x86_64-linux/homix/home/reo101.nix @@ -26,15 +26,15 @@ home.packages = with pkgs; [ ## WM - river - swww # wallpaper deamon - # wired-notify # dunst on wayland - waybar # status bar - xwayland - wl-clipboard - slurp # select regions from wayland - grim # grap images from regions - playerctl # music control + # river + # swww # wallpaper deamon + # # wired-notify # dunst on wayland + # waybar # status bar + # xwayland + # wl-clipboard + # slurp # select regions from wayland + # grim # grap images from regions + # playerctl # music control ## Terminals # wezterm @@ -45,6 +45,7 @@ git firefox discord + armcord # modded discord vifm # file editor pciutils # lspci usbutils # lsusb @@ -98,54 +99,26 @@ userEmail = "pavel.atanasov2001@gmail.com"; }; - reo101 = { + reo101 = { shell = { enable = true; direnv = true; zoxide = true; }; + river = { + enable = true; + }; wezterm = { enable = true; }; }; - systemd.user.services."swww" = { - Unit = { - Description = "Swww Daemon"; - PartOf = "graphical-session.target"; - }; - Service = { - ExecStart = "${pkgs.swww}/bin/swww init"; - ExecStop = "${pkgs.swww}/bin/swww kill"; - Type = "simple"; - Restart = "always"; - RestartSec = 5; - }; - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - }; - - # services.swww = { - # enabled = true; - # }; - - services.wired = { - enable = true; - config = ../configs/wired.ron; - }; - home.file = { ".config/nvim" = { source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/src/reovim"; }; }; - home.file.".config/river/init" = { - executable = true; - source = ../configs/river; - }; - # home.file.".stack/config.yaml".text = lib.generators.toYAML {} { # templates = { # scm-init = "git"; @@ -157,5 +130,4 @@ # }; # nix.enable = true; # }; - } diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 90d14de..1e3fbbd 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -5,5 +5,6 @@ # List your module files here # my-module = import ./my-module.nix; reo101-shell = import ./reo101-shell.nix; + reo101-river = import ./reo101-river; reo101-wezterm = import ./reo101-wezterm; } diff --git a/modules/home-manager/reo101-river/default.nix b/modules/home-manager/reo101-river/default.nix new file mode 100644 index 0000000..5c95fd9 --- /dev/null +++ b/modules/home-manager/reo101-river/default.nix @@ -0,0 +1,83 @@ +{ lib, pkgs, config, ... }: + +with lib; +let + cfg = config.reo101.river; +in +{ + imports = + [ + ]; + + options = + { + reo101.river = { + enable = mkEnableOption "reo101 river setup"; + # swww = mkOption { + # type = types.boolean; + # description = "Enable swww (wallpaper daemon)"; + # default = false; + # }; + }; + }; + + config = + mkIf cfg.enable { + home.packages = with pkgs; + builtins.concatLists [ + [ + river + swww # wallpaper deamon + waybar # status bar + xwayland + wl-clipboard + slurp # select regions from wayland + grim # grap images from regions + playerctl # music control + ] + # (optionals cfg.swww [ + # swww + # ]) + ]; + + home.file.".config/river/init" = { + executable = true; + source = ./river; + }; + + systemd.user.services."swww" = { + Unit = { + Description = "swww Daemon"; + PartOf = "graphical-session.target"; + }; + Service = { + ExecStart = "${pkgs.swww}/bin/swww init --no-daemon"; + ExecStop = "${pkgs.swww}/bin/swww kill"; + Type = "simple"; + Restart = "always"; + RestartSec = 5; + }; + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + # description = "Swww Deamon"; + # wantedBy = [ "graphical-session.target" ]; + # partOf = [ "graphical-session.target" ]; + # script = "${pkgs.swww}/bin/swww init --no-daemon"; + }; + + # services.swww = { + # enabled = true; + # }; + + # dunst on wayland + services.wired = { + enable = true; + config = ./wired.ron; + }; + }; + + meta = { + maintainers = with lib.maintainers; [ reo101 ]; + }; +} diff --git a/machines/nixos/x86_64-linux/homix/configs/river b/modules/home-manager/reo101-river/river similarity index 100% rename from machines/nixos/x86_64-linux/homix/configs/river rename to modules/home-manager/reo101-river/river diff --git a/machines/nixos/x86_64-linux/homix/configs/wired.ron b/modules/home-manager/reo101-river/wired.ron similarity index 100% rename from machines/nixos/x86_64-linux/homix/configs/wired.ron rename to modules/home-manager/reo101-river/wired.ron diff --git a/modules/home-manager/reo101-wezterm/default.nix b/modules/home-manager/reo101-wezterm/default.nix index 6d9d25e..f01b9a7 100644 --- a/modules/home-manager/reo101-wezterm/default.nix +++ b/modules/home-manager/reo101-wezterm/default.nix @@ -17,7 +17,7 @@ in type = types.str; description = "Extra zsh config"; default = '' - ''; + ''; }; }; }; diff --git a/overlays/default.nix b/overlays/default.nix index 0c94fe9..18e3c1e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -14,5 +14,16 @@ river = prev.river.overrideAttrs (oldAttrs: rec { xwaylandSupport = true; }); + + # armcord = prev.armcord.overrideAttrs (oldAttrs: let + # openasar = final.fetchurl { + # url = "https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar"; + # sha256 = final.lib.fakeSha256; + # }; + # in rec { + # postInstall = (oldAttrs.postInstall or "") ++ '' + # install -v "${openasar}" "$out/opt/Discord/resources/app.asar" + # ''; + # }); }; }