From b0f07137811d1df70e1963a1f0a4e6452271a626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 17 Sep 2023 09:25:50 +0200 Subject: [PATCH 01/33] feat(nvim)!: remove deprecated codeium extension --- flake.lock | 47 ++----------------- flake.nix | 2 - modules/programs/nvim/plugins/coding.nix | 4 -- .../programs/nvim/plugins/lua/nvim-cmp.lua | 5 +- overlays/vimPlugins.nix | 2 - 5 files changed, 6 insertions(+), 54 deletions(-) diff --git a/flake.lock b/flake.lock index dafb7f2..a66d563 100644 --- a/flake.lock +++ b/flake.lock @@ -71,27 +71,6 @@ "type": "github" } }, - "codeium-nvim": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1693966170, - "narHash": "sha256-maRkkUCzjSXK04ts+Io0WFBV1MxR7dCw8I6TV03Dpbs=", - "owner": "jcdickinson", - "repo": "codeium.nvim", - "rev": "6a8cbce54c41e0c305b5f77721f61b2ddd4b6c6d", - "type": "github" - }, - "original": { - "owner": "jcdickinson", - "repo": "codeium.nvim", - "type": "github" - } - }, "darwin": { "inputs": { "nixpkgs": [ @@ -224,21 +203,6 @@ } }, "flake-utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { "inputs": { "systems": "systems" }, @@ -256,7 +220,7 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_2": { "inputs": { "systems": "systems_3" }, @@ -274,7 +238,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_3": { "inputs": { "systems": "systems_4" }, @@ -566,7 +530,7 @@ }, "neovim-flake": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ "neovim-nightly-overlay", "nixpkgs" @@ -855,7 +819,7 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", "gitignore": "gitignore", "nixpkgs": "nixpkgs_7", "nixpkgs-stable": "nixpkgs-stable" @@ -897,8 +861,7 @@ "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", - "codeium-nvim": "codeium-nvim", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "hmts-nvim": "hmts-nvim", "home-manager": "home-manager_2", "hypr-contrib": "hypr-contrib", diff --git a/flake.nix b/flake.nix index f3bc896..5c91c13 100644 --- a/flake.nix +++ b/flake.nix @@ -53,8 +53,6 @@ actions-preview-nvim.flake = false; actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim"; - codeium-nvim.url = "github:jcdickinson/codeium.nvim"; - codeium-nvim.inputs.nixpkgs.follows = "nixpkgs"; # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 79a94bc..e44d7ab 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -86,10 +86,6 @@ with builtins; { plugin = cmp-cmdline; } { plugin = cmp-nvim-lsp; } { plugin = cmp_luasnip; } - { - plugin = codeium-nvim; - opts = { }; - } { plugin = friendly-snippets; } { plugin = lspkind-nvim; } { plugin = luasnip; } diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 1a8a070..437c4e9 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -8,9 +8,7 @@ cmp.setup({ mode = "symbol", -- show only symbol annotations maxwidth = 50, -- prevent the popup from showing more than provided characters ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead - symbol_map = { - Codeium = "", - }, + symbol_map = {}, }), }, snippet = { @@ -48,7 +46,6 @@ cmp.setup({ { name = "async_path", priority = 1 }, { name = "buffer", priority = 1 }, { name = "luasnip", priority = 2 }, - { name = "codeium", priority = 3 }, { name = "nvim_lsp", priority = 4 }, }, }) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 39f81d4..7cafdf5 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -4,8 +4,6 @@ _: prev: with lib.my; { vimPlugins = prev.vimPlugins // { - inherit (inputs.codeium-nvim.packages.${prev.system}.vimPlugins) codeium-nvim; - smartcolumn-nvim = prev.vimUtils.buildVimPluginFrom2Nix { pname = "smartcolumn-nvim"; version = mkVersionInput inputs.smartcolumn-nvim; From bfbc3ad24f9fd799ee7146cca356f7c283b753b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 17 Sep 2023 09:35:10 +0200 Subject: [PATCH 02/33] feat(nvim): add NixLazy.nvim --- flake.nix | 2 + modules/programs/nvim/default.nix | 248 +------------------ modules/programs/nvim/plugins/coding.nix | 4 +- modules/programs/nvim/plugins/treesitter.nix | 2 +- modules/programs/nvim/plugins/ui.nix | 2 +- 5 files changed, 9 insertions(+), 249 deletions(-) diff --git a/flake.nix b/flake.nix index 5c91c13..af999bc 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,7 @@ actions-preview-nvim.flake = false; actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim"; + nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim"; # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; @@ -126,6 +127,7 @@ useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit inputs self; }; + sharedModules = [ inputs.nix-lazy-nvim.homeManagerModules.default ]; }; } inputs.agenix.nixosModules.age diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 4d95a7b..bd14433 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -3,242 +3,11 @@ with lib; let cfg = config.my.programs.nvim; - toLua = value: with builtins; - if value == null then "nil" else - if isBool value then boolToString value else - if isInt value || isFloat value then toString value else - if isString value then string value else - if isAttrs value then attrs value else - if isList value then list value else - abort "should never happen (value = ${value})"; - - string = str: ''"${toString str}"''; - attrs = set: - let - toKeyword = name: value: "${name} = ${toLua value}"; - keywords = concatStringsSep ", " (mapAttrsToList toKeyword set); - in - "{ " + keywords + " }"; - - listContent = values: concatStringsSep ", " (map toLua values); - list = values: "{ " + listContent values + " }"; - - luaList = values: "{" + (concatStringsSep ", " values) + "}"; - - keybinding = { key, cmd, func, mode, desc }: - let - cmdString = - if cmd != null then toLua cmd else - if func != null then func else - abort "Either cmd or function must be set"; - descString = optionalString (desc != null) "desc = ${toLua desc},"; - in - ''{ ${toLua key}, ${cmdString}, mode = ${toLua mode}, ${descString} }''; - - lazySpecFromPlugin = - { cmd - , conf - , dependencies - , enabled - , event - , ft - , init - , keys - , lazy - , opts - , plugin - , priority - }: - - luaList - ([ - "dir = ${string plugin}" - "name = ${toLua (getName plugin)}" - ] - ++ (optional (opts != null) "opts = ${toLua opts}") - ++ (optional (lazy != null) "lazy = ${toLua lazy}") - ++ (optional (!enabled) "enabled = ${toLua enabled}") - ++ (optional (dependencies != [ ]) "dependencies = ${luaList (map lazySpecFromPlugin dependencies)}") - ++ (optional (init != null) "init = function(plugin)\n${init}\nend") - ++ (optional (conf != null) "config = function(plugin, opts)\n${conf}\nend") - ++ (optional (keys != [ ]) "keys = ${luaList (map keybinding keys)}") - ++ (optional (event != [ ]) "event = ${toLua event}") - ++ (optional (cmd != [ ]) "cmd = ${toLua cmd}") - ++ (optional (ft != [ ]) "ft = ${toLua ft}") - ++ (optional (priority != null) "priority = ${toLua priority}") - ); - lazySpecs = luaList (map lazySpecFromPlugin cfg.plugins); - lazy = /* lua */ '' - require("lazy").setup(${lazySpecs}) - ''; - - initLua = - let - text = lib.concatLines [ (builtins.readFile ./options.lua) lazy ]; - in - pkgs.runCommand "init.lua" { inherit text; } '' - touch $out - echo -n "$text" > $out - ${getExe pkgs.stylua} $out - ''; - in { imports = lib.my.listModulesRec ./plugins; - options.my.programs.nvim = { - enable = mkEnableOption "nvim"; - plugins = mkOption { - default = [ ]; - description = '' - List of plugins with config. - ''; - type = with types; listOf ( - let - sub = submodule { - options = { - conf = mkOption { - type = nullOr str; - default = null; - description = '' - Lua function to be executed when the plugin is loaded. - ''; - }; - opts = mkOption { - type = - let - valueType = nullOr - (oneOf [ - str - bool - int - float - (listOf valueType) - (attrsOf valueType) - ]) // { - description = "Lua value"; - }; - in - nullOr (attrsOf valueType); - default = null; - description = '' - Lua table to be passed to te plugin config function. - ''; - }; - dependencies = mkOption { - type = listOf sub; - default = [ ]; - description = '' - List of plugins this plugin depends on. - ''; - }; - init = mkOption { - type = nullOr str; - default = null; - description = '' - Lua code to be executed when the plugin is initialized. - ''; - }; - event = mkOption { - type = listOf str; - default = [ ]; - description = '' - Event to load the plugin on. - ''; - }; - lazy = mkOption { - type = nullOr bool; - default = null; - description = '' - Whether to load the plugin lazily. - ''; - }; - plugin = mkOption { - type = package; - description = '' - The plugin package. - ''; - }; - enabled = mkOption { - type = bool; - default = true; - description = '' - Whether to enable the plugin. - ''; - }; - cmd = mkOption { - type = listOf str; - default = [ ]; - description = '' - Command to load the plugin. - ''; - }; - ft = mkOption { - type = listOf str; - default = [ ]; - description = '' - Filetype to load the plugin on. - ''; - }; - priority = mkOption { - type = nullOr int; - default = null; - description = '' - Priority to load the plugin. - ''; - }; - keys = mkOption { - default = [ ]; - description = '' - List of keybindings. - ''; - type = listOf (submodule { - options = { - key = mkOption { - type = str; - description = '' - Key to bind. - ''; - }; - cmd = mkOption { - type = nullOr str; - default = null; - description = '' - Command to execute. - ''; - }; - func = mkOption { - type = nullOr str; - default = null; - description = '' - Function to execute. - ''; - }; - mode = mkOption { - type = listOf str; - default = [ "n" ]; - description = '' - Mode to bind the key in. - ''; - }; - desc = mkOption { - type = nullOr str; - default = null; - description = '' - Description of the keybinding. - ''; - }; - }; - }); - }; - }; - }; - in - sub - ); - }; - }; - + options.my.programs.nvim.enable = mkEnableOption "nvim"; config = mkIf cfg.enable { home-manager.users.moritz = { @@ -250,8 +19,6 @@ in ) ]; - xdg.configFile."nvim/init.lua".source = initLua; - programs.neovim = { enable = true; package = pkgs.neovim-nightly; @@ -259,14 +26,6 @@ in vimdiffAlias = true; withNodeJs = true; withPython3 = true; - extraPython3Packages = ps: - let - plugins = map (getAttr "plugin") cfg.plugins; - depAttrName = "python3Dependencies"; - filtered = filter (hasAttr depAttrName) plugins; - funcs = map (getAttr depAttrName) filtered; - in - foldl (list: f: list ++ (f ps)) [ ] funcs; extraPackages = with pkgs; [ alejandra @@ -288,9 +47,8 @@ in typst-lsp yamlfmt ]; - plugins = [ - pkgs.vimPlugins.lazy-nvim - ]; + extraLuaConfig = readFile ./options.lua; + lazy.enable = true; }; }; }; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index e44d7ab..a9e460f 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: with builtins; { - config.my.programs.nvim.plugins = with pkgs.vimPlugins; [ + config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [ { plugin = formatter-nvim; cmd = [ "Format" "Fmt" ]; diff --git a/modules/programs/nvim/plugins/treesitter.nix b/modules/programs/nvim/plugins/treesitter.nix index d4c3cf0..b76bcbc 100644 --- a/modules/programs/nvim/plugins/treesitter.nix +++ b/modules/programs/nvim/plugins/treesitter.nix @@ -2,7 +2,7 @@ with builtins; { - config.my.programs.nvim.plugins = with pkgs.vimPlugins; [ + config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [ { plugin = nvim-treesitter; event = [ "BufReadPost" "BufNewFile" ]; diff --git a/modules/programs/nvim/plugins/ui.nix b/modules/programs/nvim/plugins/ui.nix index 0e535c4..92e5fd5 100644 --- a/modules/programs/nvim/plugins/ui.nix +++ b/modules/programs/nvim/plugins/ui.nix @@ -2,7 +2,7 @@ with builtins; { - config.my.programs.nvim.plugins = with pkgs.vimPlugins; [ + config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [ { plugin = which-key-nvim; lazy = false; From 7078b97ee9f4ee86197a3023ae1974dbfdf12896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 17 Sep 2023 09:36:22 +0200 Subject: [PATCH 03/33] feat(nvim): add copilot-cmp --- modules/programs/nvim/plugins/coding.nix | 17 +++++++++++++++++ modules/programs/nvim/plugins/lua/nvim-cmp.lua | 17 ++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index a9e460f..8219567 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -89,6 +89,23 @@ with builtins; { plugin = friendly-snippets; } { plugin = lspkind-nvim; } { plugin = luasnip; } + { + plugin = copilot-cmp; + opts = { }; + dependencies = [ + { + plugin = copilot-lua; + opts = { + suggestion = { enabled = false; }; + panel = { enabled = false; }; + }; + conf = /* lua */ '' + require("copilot").setup(opts) + vim.cmd("Copilot disable") + ''; + } + ]; + } ]; } { diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 437c4e9..c48297b 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -2,13 +2,23 @@ local cmp = require("cmp") local luasnip = require("luasnip") require("luasnip.loaders.from_vscode").lazy_load() +local has_words_before = function() + if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then + return false + end + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil +end + cmp.setup({ formatting = { format = require("lspkind").cmp_format({ mode = "symbol", -- show only symbol annotations maxwidth = 50, -- prevent the popup from showing more than provided characters ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead - symbol_map = {}, + symbol_map = { + Copilot = "", + }, }), }, snippet = { @@ -24,8 +34,8 @@ cmp.setup({ [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() + if cmp.visible() and has_words_before() then + cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() else @@ -46,6 +56,7 @@ cmp.setup({ { name = "async_path", priority = 1 }, { name = "buffer", priority = 1 }, { name = "luasnip", priority = 2 }, + { name = "copilot", group_index = 3 }, { name = "nvim_lsp", priority = 4 }, }, }) From 3ee3593b0cff4275c4b27789edb44002a1e07293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 17 Sep 2023 09:37:02 +0200 Subject: [PATCH 04/33] refactor(nvim): remove unnused dependency --- flake.lock | 16 ++++++++++++++++ modules/programs/nvim/plugins/coding.nix | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index a66d563..7ff13b1 100644 --- a/flake.lock +++ b/flake.lock @@ -598,6 +598,21 @@ "type": "github" } }, + "nix-lazy-nvim": { + "locked": { + "lastModified": 1694868321, + "narHash": "sha256-LHPQkD+7ltdo77gpFQOnr8QAgYPdtFf9pm/Alwrs570=", + "ref": "refs/heads/main", + "rev": "1dc6361600111b1c46f6e85221334c8c47f88200", + "revCount": 4, + "type": "git", + "url": "https://git.moritzboeh.me/moritz/NixLazy.nvim" + }, + "original": { + "type": "git", + "url": "https://git.moritzboeh.me/moritz/NixLazy.nvim" + } + }, "nix-super": { "inputs": { "flake-compat": "flake-compat_2", @@ -870,6 +885,7 @@ "master": "master", "neovim-nightly-overlay": "neovim-nightly-overlay", "nil": "nil", + "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", "nixpkgs": "nixpkgs_6", "nvim-treesitter": "nvim-treesitter", diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 8219567..ae3d393 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -205,7 +205,6 @@ with builtins; ]; dependencies = [ { plugin = plenary-nvim; } - { plugin = which-key-nvim; } { plugin = telescope-fzf-native-nvim; } ]; } From ef9706621b684fb838001930bd5f21ee9d0629f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 19 Sep 2023 09:50:51 +0200 Subject: [PATCH 05/33] feat(fish): add sourceenv script --- modules/programs/fish.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index de683ab..ab73b47 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -61,6 +61,22 @@ in functions = { fish_greeting = ""; cheat = "cht.sh $argv | bat -p"; + sourceenv = '' + set -f envfile "$argv" + if not test -f "$envfile" + echo "Unable to load $envfile" + return 1 + end + printf "exported" + while read line + if not string match -qr '^#|^$' "$line" + set item (string split -m 1 '=' $line) + printf " $item[1]" + set -gx "$item[1]" "$item[2]" + end + end < "$envfile" + printf "\n" + ''; }; }; }; From be2bc72968384075c49c380e7662cb37f6530154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 20 Sep 2023 10:38:29 +0200 Subject: [PATCH 06/33] fix(fish): poetry completions --- overlays/fixes.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 overlays/fixes.nix diff --git a/overlays/fixes.nix b/overlays/fixes.nix new file mode 100644 index 0000000..8bfb9ba --- /dev/null +++ b/overlays/fixes.nix @@ -0,0 +1,16 @@ +{ lib, ... }: + +final: prev: { + # python-poetry/poetry#5929 + poetry = final.symlinkJoin { + name = "poetry"; + paths = [ prev.poetry ]; + postBuild = + let + regex = "s/'([a-z]*[[:blank:]][a-z]*)''/\1'/g"; + in + '' + ${lib.getExe final.gnused} -i -E "${regex}" "$out/share/fish/vendor_completions.d/poetry.fish" + ''; + }; +} From 271cbb359b25eb0efc5fa61dd4e5d2014d2f3454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 22 Sep 2023 10:14:12 +0200 Subject: [PATCH 07/33] feat: support new monitor --- hosts/nixos-desktop/default.nix | 9 +- modules/profiles/base.nix | 15 +-- modules/programs/hyprland/_config.nix | 15 ++- modules/programs/hyprland/default.nix | 121 +++++++++++++++--------- modules/programs/wallpaper/wallpaper.sh | 11 ++- modules/services/wallpaper.nix | 26 +++++ 6 files changed, 139 insertions(+), 58 deletions(-) create mode 100644 modules/services/wallpaper.nix diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 30679e6..7fbb0ce 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -17,9 +17,14 @@ gaming.enable = true; personal.enable = true; }; - programs.hyprland.nvidiaSupport = true; - programs.hyprland.keyboardLayouts = [ "us" "de" ]; + programs.hyprland = { + nvidiaSupport = true; + monitors = [ "HDMI-A-1,3840x2160,auto,1.2" ",preferred,auto,1" ]; + extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2"; + keyboardLayouts = [ "us" "de" ]; + }; services.mullvad.enable = true; + services.wallpaper.enable = true; programs.ledger.enable = true; }; diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index d79ad69..c23dcf9 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -46,7 +46,7 @@ let recurse (readlink $path) end end - + for arg in $argv recurse (which $arg) end @@ -188,11 +188,14 @@ in wget ]; - fonts.packages = with pkgs; [ - (nerdfonts.override { - fonts = [ "FiraCode" ]; - }) - ]; + fonts = { + enableDefaultPackages = true; + packages = with pkgs; [ + (nerdfonts.override { + fonts = [ "FiraCode" ]; + }) + ]; + }; programs = { mtr.enable = true; diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 281505d..8978830 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -17,7 +17,7 @@ in # # See https://wiki.hyprland.org/Configuring/Monitors/ - monitor=,preferred,auto,1 + ${concatLines (map (x: "monitor=${x}") cfg.monitors)} # See https://wiki.hyprland.org/Configuring/Keywords/ for more @@ -110,6 +110,13 @@ in workspace_swipe = on } + misc { + # disable_hypr_chan = true + vrr = 1 + mouse_move_enables_dpms = true + key_press_enables_dpms = true + } + # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # Firefox Sharing Indicator ${mkRules ["float" "move 49% 40" "noborder" "nofullscreenrequest"] ["title:^(.*Sharing Indicator.*)$"]} @@ -207,5 +214,9 @@ in bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow - exec-once=${getExe config.my.programs.wallpaper.package} -r + # Toggle waybar + bindr = $mainMod, SUPER_L, exec, pkill -USR1 waybar + + # Extra Config + ${cfg.extraConfig} '' diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 7c1cefa..8b5a2d4 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -31,6 +31,15 @@ in description = "list of keyboard layouts"; default = [ "de" "us" ]; }; + monitors = mkOption { + type = types.listOf types.str; + description = "monitor settings"; + default = [ ",preferred,auto,1" ]; + }; + extraConfig = mkOption { + type = types.str; + default = ""; + }; }; config = mkIf cfg.enable { @@ -70,6 +79,7 @@ in settings = { mainBar = { + start_hidden = true; layer = "top"; position = "top"; height = 20; @@ -81,46 +91,50 @@ in }; # lock screen after timeout - home-manager.users.moritz = { - services.swayidle = { - enable = true; - events = [ - { - event = "before-sleep"; - command = "${getExe pkgs.swaylock} -fF"; - } - { - event = "lock"; - command = "${getExe pkgs.swaylock} -fF"; - } - ]; - timeouts = - let - lockTimeout = 10; - in - [ - { - timeout = lockTimeout * 60 - 10; - command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; - } - { - timeout = lockTimeout * 60; - command = "${hyprland}/bin/hyprctl dispatch dpms off"; - resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on"; - } - { - timeout = lockTimeout * 60 + 10; - command = "${pkgs.systemd}/bin/loginctl lock-session"; - } - ] ++ optional - (!cfg.nvidiaSupport) # TODO https://github.com/hyprwm/Hyprland/issues/1728 - { - timeout = 30 * 60; - command = "${pkgs.systemd}/bin/systemctl suspend-and-hibernate"; - }; - systemdTarget = "hyprland-session.target"; + home-manager.users.moritz.programs.swaylock = { + enable = true; + settings = { + color = "000000"; }; }; + home-manager.users.moritz.services.swayidle = { + enable = true; + events = [ + { + event = "before-sleep"; + command = "${getExe pkgs.swaylock} -fF"; + } + { + event = "lock"; + command = "${getExe pkgs.swaylock} -fF"; + } + ]; + timeouts = + let + lockTimeout = 10; + in + [ + { + timeout = lockTimeout * 60 - 10; + command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; + } + { + timeout = lockTimeout * 60; + command = "${hyprland}/bin/hyprctl dispatch dpms off"; + resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on"; + } + { + timeout = lockTimeout * 60 + 10; + command = "${pkgs.systemd}/bin/loginctl lock-session"; + } + ] ++ optional + (!cfg.nvidiaSupport) # TODO https://github.com/hyprwm/Hyprland/issues/1728 + { + timeout = 30 * 60; + command = "${pkgs.systemd}/bin/systemctl suspend-and-hibernate"; + }; + systemdTarget = "hyprland-session.target"; + }; # adds pam module for swaylock security.pam.services.swaylock = { }; @@ -184,17 +198,30 @@ in alsa.support32Bit = true; pulse.enable = true; }; - xserver = { + greetd = { enable = true; - displayManager = { - lightdm.enable = true; - autoLogin = { - enable = true; - user = "moritz"; + settings = + let + hyprlandCommand = getExe' hyprland "Hyprland"; + in + { + initial_session = { + command = hyprlandCommand; + user = "moritz"; + }; + default_session = { + command = '' + ${pkgs.greetd.tuigreet}/bin/tuigreet \ + --time \ + --asterisks \ + --user-menu \ + --remember \ + --power-shutdown 'systemctl poweroff' \ + --power-reboot 'systemctl reboot' \ + --cmd ${hyprlandCommand} + ''; + }; }; - defaultSession = "hyprland"; - sessionPackages = [ hyprland ]; # can't set the defaultSession otherwise - }; }; }; security.rtkit.enable = true; diff --git a/modules/programs/wallpaper/wallpaper.sh b/modules/programs/wallpaper/wallpaper.sh index 8e94670..649d663 100755 --- a/modules/programs/wallpaper/wallpaper.sh +++ b/modules/programs/wallpaper/wallpaper.sh @@ -2,6 +2,7 @@ WALLPAPERS_PATH="$HOME/.config/wallpapers" WALLPAPERS=$(find "$WALLPAPERS_PATH" -type f,l) +DEBUG=0 function help() { echo "Usage:" @@ -22,7 +23,11 @@ function setWallpaperX { } function setWallpaperWayland { - swaybg --mode fill -i "$1" 2>/dev/null & + if [[ $DEBUG -eq 1 ]]; then + swaybg --mode fill -i "$1" & + else + swaybg --mode fill -i "$1" 2>/dev/null & + fi } function setWallpaper() { @@ -53,6 +58,10 @@ while [[ $# -gt 0 ]]; do shift # past argument shift # past value ;; + -v | --verbose) + DEBUG=1 + shift # past argument + ;; *) POSITIONAL+=("$1") # save it in an array for later shift # past argument diff --git a/modules/services/wallpaper.nix b/modules/services/wallpaper.nix new file mode 100644 index 0000000..a6367d3 --- /dev/null +++ b/modules/services/wallpaper.nix @@ -0,0 +1,26 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.my.services.wallpaper; +in +{ + options.my.services.wallpaper = { + enable = mkEnableOption "wallpaper changer"; + frequency = mkOption { + type = types.str; + default = "30m"; + }; + }; + + config = mkIf cfg.enable { + systemd.user.services.wallpaper = { + script = "${getExe config.my.programs.wallpaper.package} -r -v"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + Restart = "always"; + RuntimeMaxSec = cfg.frequency; + ExitType = "cgroup"; + }; + }; + }; +} From ef0ec4693c9041efca5017a234ea6ed44b61a43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 23 Sep 2023 09:46:46 +0200 Subject: [PATCH 08/33] feat: new abbreviations --- modules/profiles/base.nix | 2 ++ modules/programs/fish.nix | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index c23dcf9..e76753c 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -105,6 +105,8 @@ in abbreviations = { us = "systemctl --user"; rs = "sudo systemctl"; + uj = "journalctl --user"; + rj = "sudo journalctl"; }; aliases = { ls = "exa -lh --icons --git"; diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 3e9293c..c29dd7c 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -46,14 +46,46 @@ in # visual mode, but due to fish_cursor_default, is redundant here set fish_cursor_visual block + # Complex abbreviations + function last_history_item + echo $history[1] + end + abbr -a !! --position anywhere --function last_history_item + + function sed_history_item + echo $history[1] | perl -p -e (string trim -l --chars=! $argv) + end + abbr -a sed_history --position command --regex '^!s/.+/.*/g?' --function sed_history_item + + function multicd + echo cd (string repeat -n (math (string length -- $argv[1]) - 1) ../) + end + abbr --add dotdot --regex '^\.\.+$' --function multicd + + abbr -a P --position anywhere --set-cursor "% | $PAGER" + + function editor_edit + echo $EDITOR $argv + end + abbr -a editor_edit_files --position command --regex ".+\.(txt|md|org)" --function editor_edit + + function editor + echo $EDITOR + end + abbr -a e --function editor + # Completions complete -c c -kfa '(zoxide query -l | sed "s|$HOME|~|")' ${optionalString config.virtualisation.podman.dockerCompat /* fish */ "complete -c docker -w podman"} + complete -c nom -fn "not __fish_seen_subcommand_from build shell develop" -a "build shell develop" + + complete -c nom -fn "__fish_seen_subcommand_from build" -w "nix build" + complete -c nom -fn "__fish_seen_subcommand_from shell" -w "nix shell" + complete -c nom -fn "__fish_seen_subcommand_from develop" -w "nix develop" complete -c timers \ -n "__fish_seen_subcommand_from toggle" \ -fa '(timers --json l | ${getExe pkgs.jq} -r .[][].name)' - complete -c timers \ -n "__fish_seen_subcommand_from remove" \ -fa '(timers --json l | ${getExe pkgs.jq} -r .[][].name)' From cb539cc874dc15ec5a9530a77cf0bb11fb00391d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 23 Sep 2023 09:47:30 +0200 Subject: [PATCH 09/33] feat: remove builder --- modules/profiles/personal.nix | 19 ------------------- secrets/secrets.nix | 1 - secrets/ssh-builder.age | 10 ---------- 3 files changed, 30 deletions(-) delete mode 100644 secrets/ssh-builder.age diff --git a/modules/profiles/personal.nix b/modules/profiles/personal.nix index d56b796..bfea3e2 100644 --- a/modules/profiles/personal.nix +++ b/modules/profiles/personal.nix @@ -69,24 +69,5 @@ in }; }; }; - nix.buildMachines = [{ - hostName = "builder"; - systems = [ "aarch64-linux" "x86_64-linux" ]; - protocol = "ssh-ng"; - maxJobs = 1; - speedFactor = 1; - supportedFeatures = [ "nixos-test" "benchmark" "kvm" ]; - mandatoryFeatures = [ ]; - }]; - nix.distributedBuilds = true; - # optional, useful when the builder has a faster internet connection than yours - nix.extraOptions = '' - builders-use-substitutes = true - ''; - age.secrets."ssh-builder" = { - file = ../../secrets/ssh-builder.age; - owner = "0"; - path = "/root/.ssh/config"; - }; }; } diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 7c7267c..d2a471e 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -18,7 +18,6 @@ in { "github.age".publicKeys = all; "ssh-home.age".publicKeys = personal; - "ssh-builder.age".publicKeys = personal; "uni-vpn.age".publicKeys = personal; "wireguard-preshared-key.age".publicKeys = personal; "wireguard-private-key.age".publicKeys = personal; diff --git a/secrets/ssh-builder.age b/secrets/ssh-builder.age deleted file mode 100644 index ba15122..0000000 --- a/secrets/ssh-builder.age +++ /dev/null @@ -1,10 +0,0 @@ -age-encryption.org/v1 --> ssh-ed25519 wG6LYg 5umyOPP+KaUaQckEZYnh+nyX2RIMDp/KtJraFuATQBM -qsS9JiY0qxR7IMwpH2x1VWF5A5/wrAkbeOzuMcf1fS0 --> ssh-ed25519 ZYd7Zg L9EJulnOPk7fEcmrWU8mVRbEN80dHCji1n4bnwGJigk -KTnk+Ku96gJ7Tj2egXyqX6UIuytHTuMFM1ygDXoIDxg --> XQ.ai[-grease a ) r]>2~U -7CDc3c+1EZaEB15RE8JMzmdbr2WmQeP2ivIh4qgYTnKImHxJaJEhgScd0EzyEXVP -NZxuP+0 ---- CE/X6hjRUWT1ya1ySIjFBnLdmPkVbL4ugDwYv9XGYoo -߉38e:ImF?U~83NCzAM]0fkuFLl Date: Sat, 23 Sep 2023 09:49:35 +0200 Subject: [PATCH 10/33] feat: remove unused packages --- modules/profiles/base.nix | 20 +++----------------- modules/profiles/desktop.nix | 4 ---- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index e76753c..845d53f 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -116,8 +116,6 @@ in cd = "__zoxide_z"; nixos-update = "pushd ~/.dotfiles && nix flake update && popd"; - - latexwatch = ''find -type f -name "*.tex" | entr -c latexmk -pdf -silent''; }; variables = { EDITOR = "vim"; }; }; @@ -153,38 +151,26 @@ in # archives ouch - # file management - trash-cli - # monitoring - htop bottom # nix (nom-system-command "nixos-boot" "sudo nixos-rebuild boot --flake ~/.dotfiles") (nom-system-command "nixos-switch" "sudo nixos-rebuild switch --flake ~/.dotfiles") (nom-system-command "nixos-test" "sudo nixos-rebuild test --flake ~/.dotfiles") - manix - nix-index nix-output-monitor nixpkgs-fmt - statix which-nix - # other + # utils bat cht-sh - du-dust - duf - entr exa f + fd gi - gparted - neofetch - reptyr + parallel ripgrep - up vim viu wget diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index f23ec05..5afad86 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -84,11 +84,7 @@ in }; environment.systemPackages = with pkgs; [ - anki - calibre - fd keepassxc - nixpkgs-review pavucontrol stable.libreoffice # NOTE breaks often stable.signal-desktop # NOTE breaks often From 0603a18d9e4ab2153afc5313dd7e9d4f072bd27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 23 Sep 2023 09:50:12 +0200 Subject: [PATCH 11/33] feat: move caches to flake --- flake.nix | 13 +++++++++++++ modules/programs/nix.nix | 8 -------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 8e518a6..cf501b2 100644 --- a/flake.nix +++ b/flake.nix @@ -211,4 +211,17 @@ default = overlay; }; }; + + nixConfig = { + extra-substituters = [ + "https://hyprland.cachix.org" + "https://nix-community.cachix.org" + "https://pre-commit-hooks.cachix.org" + ]; + extra-trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" + ]; + }; } diff --git a/modules/programs/nix.nix b/modules/programs/nix.nix index c358dbc..61025b4 100644 --- a/modules/programs/nix.nix +++ b/modules/programs/nix.nix @@ -57,17 +57,9 @@ in settings = { substituters = [ "https://cache.nixos.org/" - "https://jupyterwith.cachix.org" - "https://nix-community.cachix.org" - "https://pre-commit-hooks.cachix.org" - "https://hyprland.cachix.org" ]; trusted-public-keys = [ - "jupyterwith.cachix.org-1:/kDy2B6YEhXGJuNguG1qyqIodMyO4w8KwWH4/vAc7CI=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; trusted-users = [ "root" "@wheel" ]; From f43b9938694974b67ab015435e8c1049bbd9ab55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 25 Sep 2023 18:29:29 +0200 Subject: [PATCH 12/33] feat: make nixos-laptop empheral --- flake.lock | 249 +++++++++++------- flake.nix | 5 + hosts/nixos-laptop/default.nix | 20 +- hosts/nixos-laptop/disko.nix | 94 +++++++ hosts/nixos-laptop/hardware-configuration.nix | 41 --- hosts/nixos-laptop/impermanence.nix | 70 +++++ modules/profiles/base.nix | 6 +- modules/programs/hyprland/default.nix | 31 +-- modules/programs/nvim/options.lua | 8 +- secrets/moritz-password.age | 11 + secrets/root-password.age | Bin 0 -> 625 bytes secrets/secrets.nix | 2 + 12 files changed, 355 insertions(+), 182 deletions(-) create mode 100644 hosts/nixos-laptop/disko.nix create mode 100644 hosts/nixos-laptop/impermanence.nix create mode 100644 secrets/moritz-password.age create mode 100644 secrets/root-password.age diff --git a/flake.lock b/flake.lock index 7ff13b1..a3e2659 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1690228878, - "narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=", + "lastModified": 1695384796, + "narHash": "sha256-TYlE4B0ktPtlJJF9IFxTWrEeq+XKG8Ny0gc2FGEAdj0=", "owner": "ryantm", "repo": "agenix", - "rev": "d8c973fd228949736dedf61b7f8cc1ece3236792", + "rev": "1f677b3e161d3bdbfd08a939e8f25de2568e0ef4", "type": "github" }, "original": { @@ -41,11 +41,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1693196107, - "narHash": "sha256-t6qvPFJIF+De2KqMfCI5DEA40BwWeu4AFRWOzKeEVE0=", + "lastModified": 1695299795, + "narHash": "sha256-rl6WSgyXTbSLXL3ItpbfToSPAS4+rftojSzFWxNuHU4=", "owner": "arkenfox", "repo": "user.js", - "rev": "ba173d49205ee927ed62e81e606569d98f531d38", + "rev": "56f51203bf4fea8aa778b792269205d275a62665", "type": "github" }, "original": { @@ -93,6 +93,24 @@ "type": "github" } }, + "disko": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1695380190, + "narHash": "sha256-v1TwBU/mKroZZPWYXujAfOHfIaQw44swa50Jgdkr7OE=", + "owner": "nix-community", + "repo": "disko", + "rev": "98a6ab9b52f8b06db9c3116b1761bbeaf9484408", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -207,11 +225,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1692799911, - "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -297,7 +315,7 @@ "inputs": { "flake-parts": "flake-parts_3", "haskell-flake": "haskell-flake", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1688568579, @@ -379,11 +397,11 @@ ] }, "locked": { - "lastModified": 1693972774, - "narHash": "sha256-Dt9UZs0/DaIex598quYRYFuGabUbvFdNrHuvGc6HjBc=", + "lastModified": 1695550077, + "narHash": "sha256-xoxR/iY69/3lTnnZDP6gf3J46DUKPcf+Y1jH03tfZXE=", "owner": "nix-community", "repo": "home-manager", - "rev": "b22d7bab30076bbb73744867d6c5bf7d6380570c", + "rev": "a88df2fb101778bfd98a17556b3a2618c6c66091", "type": "github" }, "original": { @@ -394,14 +412,14 @@ }, "hypr-contrib": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1693839821, - "narHash": "sha256-ha9Cxqb81Yni217SoM/zFxE0nNz8IMtreTw4SlXw/D4=", + "lastModified": 1695455081, + "narHash": "sha256-AtAMze2J5Maol28OLQoCFgppRWEy06Mn9RhduXNmhiI=", "owner": "hyprwm", "repo": "contrib", - "rev": "74aa6b02ff4bd48aaee4da461a16c4cbaaa0ca7e", + "rev": "33663f663e07b4ca52c9165f74e3d793f08b15e7", "type": "github" }, "original": { @@ -413,17 +431,17 @@ "hyprland": { "inputs": { "hyprland-protocols": "hyprland-protocols", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "systems": "systems_2", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1693944974, - "narHash": "sha256-kWa86ahIQvQIgo3GYFJShlBuKTXfggVbrZjkbdjct7U=", + "lastModified": 1695558936, + "narHash": "sha256-KcSkwSDlrt3Xwtit+NTu2aToiRm5Aho9joj2r6nb19w=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "c3a83daa1e61285a418c39a1d9f29427c2c9a2c3", + "rev": "352ceb1117b79cd0bc3fa86ebe435b6909512ddb", "type": "github" }, "original": { @@ -459,14 +477,14 @@ }, "hyprpaper": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1692480535, - "narHash": "sha256-3Q0Uz/JPW9USHyAmrzRl6KhZLqMYTWkmtL3RA+oAeVY=", + "lastModified": 1694600309, + "narHash": "sha256-d9LcB+D0bfMu+8UhnUVJ/DX5OVTX6o5dIntdVqEeQDA=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "5e73eb60552d48d55541c60f9a8da2b666003fe6", + "rev": "e5a18a171d5d6e7c6b9ffdfb9e86fb09055964a1", "type": "github" }, "original": { @@ -475,6 +493,21 @@ "type": "github" } }, + "impermanence": { + "locked": { + "lastModified": 1694622745, + "narHash": "sha256-z397+eDhKx9c2qNafL1xv75lC0Q4nOaFlhaU1TINqb8=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "e9643d08d0d193a2e074a19d4d90c67a874d932e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, "lowdown-src": { "flake": false, "locked": { @@ -493,11 +526,11 @@ }, "master": { "locked": { - "lastModified": 1693980916, - "narHash": "sha256-J7JJCpNiHbXb3D7pb1JkeOTUEpJJXiGI6BngfbnhiIM=", + "lastModified": 1695566498, + "narHash": "sha256-pitC2KSFFQr0VVWTWrhOYM3JkHMTGJ+n2f3swZNRjq8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6485865ec300c7baf9e51ad5d64c30355ee511e7", + "rev": "46338210c41bbb92502517cccbb2223973a17a62", "type": "github" }, "original": { @@ -538,11 +571,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1693954768, - "narHash": "sha256-DIyHgdfhmftTN2aHVEmJ1q/W2o0Slild0McAf4sEa8U=", + "lastModified": 1695509205, + "narHash": "sha256-nV3opNLzLMfzL0yI+xnIeNIOnvOI467CiABxHTQUrwY=", "owner": "neovim", "repo": "neovim", - "rev": "2ef7b6a433c61837bcef0fca297a665551835423", + "rev": "bc0bf9d030bbcb01db69c44cf88b95ca41dd3065", "type": "github" }, "original": { @@ -558,14 +591,14 @@ "flake-parts": "flake-parts", "hercules-ci-effects": "hercules-ci-effects", "neovim-flake": "neovim-flake", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1693958686, - "narHash": "sha256-UgdB+EXYbi90vm2fam4tYgY9hYGwxSk0sxG96jIyeg4=", + "lastModified": 1695513850, + "narHash": "sha256-tzhm05TH22eI+ePzuPHrMgq2sjLkEW1q1E515+VRVuw=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "14defe836200c45acf14f3616d7ba20959028cf8", + "rev": "07c3b00574cb6645d92786c5a5531cb20426785d", "type": "github" }, "original": { @@ -585,11 +618,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1693724255, - "narHash": "sha256-+Ucv/aBN9wwRE62sUJEBocI+9no7PV4KRDNuFQgygzU=", + "lastModified": 1695485017, + "narHash": "sha256-aQyRBJnT4tftexM/Y3etfOk8tfMFZzt+vSVtL2J0KLY=", "owner": "oxalica", "repo": "nil", - "rev": "4bdcfcfe38cfcb386142e043392afbfa542665dd", + "rev": "510bc6e9b41d39c81b9c815065cb5b7e23a2428c", "type": "github" }, "original": { @@ -623,11 +656,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1692913762, - "narHash": "sha256-WIz/rGYBUdRtkZx5BPbE9DXHfUCKlYuKkPzDsP4u77w=", + "lastModified": 1695405275, + "narHash": "sha256-R4TX73TAzrW03Rdsa4HNz5ASKx5S1AKa/3SAntUHglg=", "owner": "privatevoid-net", "repo": "nix-super", - "rev": "0007178284d0247631af40931b7039d42bfc0da5", + "rev": "cae2c834f2a19db35cd46d233f5b59086b24a6f1", "type": "github" }, "original": { @@ -638,16 +671,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1658161305, - "narHash": "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=", + "lastModified": 1694948089, + "narHash": "sha256-d2B282GmQ9o8klc22/Rbbbj6r99EnELQpOQjWMyv0rU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e4d49de45a3b5dbcb881656b4e3986e666141ea9", + "rev": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -704,11 +737,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1693158576, - "narHash": "sha256-aRTTXkYvhXosGx535iAFUaoFboUrZSYb1Ooih/auGp0=", + "lastModified": 1658161305, + "narHash": "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a999c1cc0c9eb2095729d5aa03e0d8f7ed256780", + "rev": "e4d49de45a3b5dbcb881656b4e3986e666141ea9", "type": "github" }, "original": { @@ -719,6 +752,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1694767346, + "narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ace5093e36ab1e95cb9463863491bee90d5a4183", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1683014792, "narHash": "sha256-6Va9iVtmmsw4raBc3QKvQT2KT/NGRWlvUlJj46zN8B8=", @@ -734,7 +783,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1688322751, "narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=", @@ -750,39 +799,39 @@ "type": "github" } }, - "nixpkgs_5": { - "locked": { - "lastModified": 1693844670, - "narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_6": { "locked": { - "lastModified": 1693844670, - "narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=", - "owner": "nixos", + "lastModified": 1695318763, + "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1", + "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_7": { + "locked": { + "lastModified": 1695318763, + "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { "locked": { "lastModified": 1689261696, "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", @@ -798,7 +847,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1692934111, "narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=", @@ -836,15 +885,15 @@ "flake-compat": "flake-compat_3", "flake-utils": "flake-utils_3", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1692274144, - "narHash": "sha256-BxTQuRUANQ81u8DJznQyPmRsg63t4Yc+0kcyq6OLz8s=", + "lastModified": 1694364351, + "narHash": "sha256-oadhSCqopYXxURwIA6/Anpe5IAG11q2LhvTJNP5zE6o=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "7e3517c03d46159fdbf8c0e5c97f82d5d4b0c8fa", + "rev": "4f883a76282bc28eb952570afc3d8a1bf6f481d7", "type": "github" }, "original": { @@ -856,11 +905,11 @@ "rofi-wayland": { "flake": false, "locked": { - "lastModified": 1690115482, - "narHash": "sha256-fUneGsSWpi8zYrTbF14e/fuf0vaXF8ckOo4OhL1tInM=", + "lastModified": 1695513431, + "narHash": "sha256-WG1EyBYTbDsK4RsPgp8K/PlscvRSNthQSyN3cqxuXcc=", "owner": "lbonn", "repo": "rofi", - "rev": "ff2338c38fbf6e7049563acf55f9055bcf882a4e", + "rev": "b8dedc8836b552a0bba5f4702be63dd8521c6fbb", "type": "github" }, "original": { @@ -876,18 +925,20 @@ "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", + "disko": "disko", "flake-utils": "flake-utils", "hmts-nvim": "hmts-nvim", "home-manager": "home-manager_2", "hypr-contrib": "hypr-contrib", "hyprland": "hyprland", "hyprpaper": "hyprpaper", + "impermanence": "impermanence", "master": "master", "neovim-nightly-overlay": "neovim-nightly-overlay", "nil": "nil", "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "nvim-treesitter": "nvim-treesitter", "pre-commit-hooks": "pre-commit-hooks", "rofi-wayland": "rofi-wayland", @@ -926,11 +977,11 @@ "smartcolumn-nvim": { "flake": false, "locked": { - "lastModified": 1693669522, - "narHash": "sha256-SfIbbrAFv/md9EgsJvO0RfDnc6oP5RYz8C5Icual1bU=", + "lastModified": 1694526430, + "narHash": "sha256-O9lPx4WVtiH8tCXVGtNHpcNDDIC+IdcZl8ielDD+rcY=", "owner": "m4xshen", "repo": "smartcolumn.nvim", - "rev": "d01b99355c7fab13233f48d0f28dc097e68a03f7", + "rev": "c6abf3917fcec487c7475e208ae37f5788af5b04", "type": "github" }, "original": { @@ -941,11 +992,11 @@ }, "stable": { "locked": { - "lastModified": 1693771906, - "narHash": "sha256-32EnPCaVjOiEERZ+o/2Ir7JH9pkfwJZJ27SKHNvt4yk=", + "lastModified": 1695416179, + "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "da5adce0ffaff10f6d0fee72a02a5ed9d01b52fc", + "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", "type": "github" }, "original": { @@ -1033,11 +1084,11 @@ "telekasten-nvim": { "flake": false, "locked": { - "lastModified": 1691743763, - "narHash": "sha256-zYBMUzanFtjnsUrwxjHLvhRODLj1uwGi18wMUWnrqRA=", + "lastModified": 1694166243, + "narHash": "sha256-DblFcMlXsiHJCFojjpcwqZdnRqGuk79yoNBJTR8p5S4=", "owner": "renerocksai", "repo": "telekasten.nvim", - "rev": "584783fdbdd13bb691a435f86ed10a3717fa9e9a", + "rev": "bd5d323581f24ee124b33688287e6a22244c6f2a", "type": "github" }, "original": { @@ -1049,11 +1100,11 @@ "telescope-nvim": { "flake": false, "locked": { - "lastModified": 1693850759, - "narHash": "sha256-309GezR93SVOD7/B8dDJIEidYziepc1s46CIRkhND1k=", + "lastModified": 1695500955, + "narHash": "sha256-Sy4cDVL9HdIj8/UkCnusxACuzA6PKQiuf5Otwtlf8HA=", "owner": "nvim-telescope", "repo": "telescope.nvim", - "rev": "20a37e43bb43c74c6091f9fea6551af0964ad45a", + "rev": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8", "type": "github" }, "original": { @@ -1065,7 +1116,7 @@ "timers": { "inputs": { "naersk": "naersk", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "utils": "utils" }, "locked": { @@ -1104,18 +1155,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1692976565, - "narHash": "sha256-eBKkG7tMxg92NskEn8dHRFY245JwjirWRoOZzW6DnUw=", + "lastModified": 1695277534, + "narHash": "sha256-LEIUGXvKR5DYFQUTavC3yifcObvG4XZUUHfxXmu8nEM=", "owner": "wlroots", "repo": "wlroots", - "rev": "717ded9bb0191ea31bf4368be32e7a15fe1b8294", + "rev": "98a745d926d8048bc30aef11b421df207a01c279", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "717ded9bb0191ea31bf4368be32e7a15fe1b8294", + "rev": "98a745d926d8048bc30aef11b421df207a01c279", "type": "gitlab" } }, @@ -1135,11 +1186,11 @@ ] }, "locked": { - "lastModified": 1691841170, - "narHash": "sha256-RCTm1/MVWYPnReMgyp7tr2ogGYo/pvw38jZaFwemgPU=", + "lastModified": 1694628480, + "narHash": "sha256-Qg9hstRw0pvjGu5hStkr2UX1D73RYcQ9Ns/KnZMIm9w=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "57a3a41ba6b358109e4fc25c6a4706b5f7d93c6b", + "rev": "8f45a6435069b9e24ebd3160eda736d7a391cbf2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index cf501b2..fb57451 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,9 @@ rofi-wayland.url = "github:lbonn/rofi/wayland"; rofi-wayland.flake = false; + disko.url = "github:nix-community/disko"; + impermanence.url = "github:nix-community/impermanence"; + # Neovim neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; @@ -130,6 +133,8 @@ }; } inputs.agenix.nixosModules.age + inputs.disko.nixosModules.default + inputs.impermanence.nixosModules.impermanence ]; hosts = self.lib.my.mapModules diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 6011e4c..20c12bd 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -3,37 +3,35 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { pkgs , inputs +, lib , ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./disko.nix + ./impermanence.nix ]; my = { virtualisation.libvirtd.enable = true; + yubikey.luksSupport.enable = false; profiles = { desktop.enable = true; personal.enable = true; - webis.enable = true; + # webis.enable = true; }; + shell.aliases.zfs-diff = "sudo zfs diff zroot/encrypted/root@blank | parallel --pipe cut -f2 | parallel 'test -e /persist/{} || echo {}' | ${lib.getExe pkgs.tree} --fromfile ."; }; home-manager.users.moritz.home.packages = with pkgs; [ - jetbrains.idea-ultimate + # jetbrains.idea-ultimate ]; # BOOT boot = { - supportedFilesystems = [ "btrfs" ]; - loader = { - grub = { - enable = true; - device = "nodev"; - efiSupport = true; - }; - efi.canTouchEfiVariables = true; - }; + supportedFilesystems = [ "zfs" ]; + loader.systemd-boot.enable = true; }; # SERVICES diff --git a/hosts/nixos-laptop/disko.nix b/hosts/nixos-laptop/disko.nix new file mode 100644 index 0000000..d93e34b --- /dev/null +++ b/hosts/nixos-laptop/disko.nix @@ -0,0 +1,94 @@ +{ lib, ... }: + +{ + # needed for zfs pool + networking.hostId = "9c85d185"; + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "64M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "zroot"; + }; + }; + }; + }; + }; + }; + zpool = { + zroot = { + type = "zpool"; + rootFsOptions = { + compression = "zstd"; + "com.sun:auto-snapshot" = "false"; + }; + mountpoint = null; + + datasets = { + encrypted = { + type = "zfs_fs"; + options = { + mountpoint = "none"; + encryption = "aes-256-gcm"; + keyformat = "passphrase"; + }; + # use this to read the key during boot + postCreateHook = '' + zfs set keylocation="prompt" "zroot/$name"; + ''; + }; + "encrypted/root" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/"; + postCreateHook = "zfs snapshot zroot/encrypted/root@blank"; + }; + "encrypted/nix" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/nix"; + }; + "encrypted/persist" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/persist"; + options."com.sun:auto-snapshot" = "true"; + }; + }; + }; + }; + }; + # rollback to blank + boot.initrd.postDeviceCommands = lib.mkAfter '' + zfs rollback -r zroot/encrypted/root@blank + ''; + fileSystems."/persist".neededForBoot = true; + # HACK: to fix issue of agenix running before impermanence + age.identityPaths = [ + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_rsa_key" + "/persist/etc/ssh/ssh_host_ed25519_key" + "/persist/etc/ssh/ssh_host_rsa_key" + ]; + services.zfs = { + autoScrub.enable = true; + trim.enable = true; + autoSnapshot.enable = true; + }; +} diff --git a/hosts/nixos-laptop/hardware-configuration.nix b/hosts/nixos-laptop/hardware-configuration.nix index 76defb8..25d25d4 100644 --- a/hosts/nixos-laptop/hardware-configuration.nix +++ b/hosts/nixos-laptop/hardware-configuration.nix @@ -10,45 +10,4 @@ boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - - - fileSystems."/" = { - device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" ]; - }; - - boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/078b81ba-238e-471d-9951-b743588532b8"; - - fileSystems."/log" = { - device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; - fsType = "btrfs"; - options = [ "subvol=log" "compress=zstd" ]; - neededForBoot = true; - }; - - fileSystems."/nix" = { - device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; - fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" ]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/938D-F813"; - fsType = "vfat"; - }; - - fileSystems."/persist" = { - device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; - fsType = "btrfs"; - options = [ "subvol=persist" "compress=zstd" ]; - }; - - fileSystems."/home" = { - device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154"; - fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" ]; - }; - - swapDevices = [{ device = "/dev/disk/by-uuid/29ebf65f-e6ca-4625-9f72-a9321152be1b"; }]; } diff --git a/hosts/nixos-laptop/impermanence.nix b/hosts/nixos-laptop/impermanence.nix new file mode 100644 index 0000000..b5c697a --- /dev/null +++ b/hosts/nixos-laptop/impermanence.nix @@ -0,0 +1,70 @@ +{ config, ... }: + +{ + age.secrets = { + root-password.file = ../../secrets/root-password.age; + moritz-password.file = ../../secrets/moritz-password.age; + }; + users.users = { + root.hashedPasswordFile = config.age.secrets.root-password.path; + moritz.hashedPasswordFile = config.age.secrets.moritz-password.path; + }; + users.mutableUsers = false; + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/etc/NetworkManager/system-connections" + "/var/db/dhcpcd/" + "/var/lib/NetworkManager/" + "/var/lib/bluetooth" + "/var/lib/nixos" + "/var/lib/systemd/coredump" + "/var/log" + ]; + files = [ + "/etc/machine-id" + "/etc/nix/id_rsa" + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + "/etc/ssh/ssh_host_rsa_key" + "/etc/ssh/ssh_host_rsa_key.pub" + ]; + users.moritz = { + directories = [ + ".SynologyDrive/data" + ".SynologyDrive/log" + ".cache/keepassxc" + ".cache/nvim/luac" + ".config/Nextcloud" + ".config/keepassxc" + ".local/share/direnv" + ".local/share/zoxide" + ".local/state/nvim" + ".mozilla" + "Documents" + "Downloads" + "Music" + "Pictures" + "Videos" + { directory = ".gnupg"; mode = "0700"; } + { directory = ".local/share/keyrings"; mode = "0700"; } + { directory = ".ssh"; mode = "0700"; } + ]; + files = [ + ".local/share/fish/fish_history" + ".local/share/nix/trusted-settings.json" + ".parallel/will-cite" + ]; + }; + users.root = { + home = "/root"; + directories = [ + { directory = ".gnupg"; mode = "0700"; } + { directory = ".ssh"; mode = "0700"; } + ]; + files = [ + ".local/share/nix/trusted-settings.json" + ]; + }; + }; +} diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 845d53f..bab1dd9 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -84,6 +84,9 @@ let }; in { + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGoAqa2m7hIzZ2LS96Z+RCIlRvhBM/j7h27tMBCwMT+a" # Moritz + ]; users.users.moritz = { isNormalUser = true; home = "/home/moritz"; @@ -109,7 +112,7 @@ in rj = "sudo journalctl"; }; aliases = { - ls = "exa -lh --icons --git"; + ls = "${getExe pkgs.eza} -lh --icons --git"; cat = "bat"; rm = "rm -i"; mv = "mv -i"; @@ -165,7 +168,6 @@ in # utils bat cht-sh - exa f fd gi diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 8b5a2d4..6bbeff6 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -198,30 +198,17 @@ in alsa.support32Bit = true; pulse.enable = true; }; - greetd = { + xserver = { enable = true; - settings = - let - hyprlandCommand = getExe' hyprland "Hyprland"; - in - { - initial_session = { - command = hyprlandCommand; - user = "moritz"; - }; - default_session = { - command = '' - ${pkgs.greetd.tuigreet}/bin/tuigreet \ - --time \ - --asterisks \ - --user-menu \ - --remember \ - --power-shutdown 'systemctl poweroff' \ - --power-reboot 'systemctl reboot' \ - --cmd ${hyprlandCommand} - ''; - }; + displayManager = { + lightdm.enable = true; + autoLogin = { + enable = true; + user = "moritz"; }; + defaultSession = "hyprland"; + sessionPackages = [ hyprland ]; # can't set the defaultSession otherwise + }; }; }; security.rtkit.enable = true; diff --git a/modules/programs/nvim/options.lua b/modules/programs/nvim/options.lua index 8fa8a70..891b09c 100644 --- a/modules/programs/nvim/options.lua +++ b/modules/programs/nvim/options.lua @@ -1,14 +1,8 @@ vim.g.mapleader = " " vim.g.maplocalleader = "," --- FIX to create spell dir if not existent -local spelldir = vim.fn.stdpath("config") .. "/spell" -if not vim.loop.fs_stat(spelldir) then - vim.fn.mkdir(spelldir, "p") -end - vim.opt.autoindent = true -vim.opt.backupdir = { vim.fn.stdpath("state") .. "/nvim/backup/" } -- don't store backup in files dir +vim.opt.backupdir = { vim.fn.stdpath("state") .. "/backup/" } -- don't store backup in files dir vim.opt.clipboard = "unnamedplus" -- sync with system clipboard vim.opt.conceallevel = 2 vim.opt.expandtab = true -- spaces instead of tabs diff --git a/secrets/moritz-password.age b/secrets/moritz-password.age new file mode 100644 index 0000000..739e7ee --- /dev/null +++ b/secrets/moritz-password.age @@ -0,0 +1,11 @@ +age-encryption.org/v1 +-> ssh-ed25519 wG6LYg LK0u1kmnMlRkk3s1nqpHREr0pbtQwc+Or9XFGSk5Syo +HLc3gWskZTeWfMPgR+EBn3R3ycn+7rWKgheZuP4o9Tg +-> ssh-ed25519 ZYd7Zg w8wh8buUNQcPdihFgWVyZfCg74x01YTSbnj8Sw5dhBQ +i8/rwKnUn2QIuTpLayg1+SzUnHbpOu7CdhAnO3u3/VU +-> ssh-ed25519 CjuqfA FPR6pGls0nRXB7lFUagHCcY39iuoSBab+T40aMuD8hQ +pyrcWA0Knw0iZf8CpfvmP5hsJf0Gba9LBKSQO1yGfbQ +-> CQVJ}-grease pf }&% +7Q +--- Mn5qor9GWHRU52zTv+kCqQljCZYsG1tO6ekZSH/p1yc +JODa0CcrX*F\uAFO sKt<(5JMTDvR?Me \ No newline at end of file diff --git a/secrets/root-password.age b/secrets/root-password.age new file mode 100644 index 0000000000000000000000000000000000000000..bf61174b5536fe050aa726fa95fd56fcfefdceec GIT binary patch literal 625 zcmZ9{J&V&|003acEvtv1pk{Hg#->TrG@wF~Cb=|kn_k;AO#~rrzAw#ZlYWfCxhQfc zy6EC^i#QyJ=z)XNIrt9_JP8adii^7{x>XeHLgxrC% z%tb5{BZvwG&x9J#92gf&RhK#_?>6hX(gUCsC*dH=C-wEdB9n2~Q~Z4F;|}XUpb>-4 z#5cRS+3qD0qvR%?30O@AQ6uH+v8zi(lBJv=h^IAOGfCZn^>M46PR7GDwD?eOo5RX1 zA1Jn8D5i?`(ps!?HZCrz?LG>rGhAOXOWNnq#F`Nz6SVCB2>P;9pljVg;3gwOQwLM2 zKR&IoexBGg?23NF^)RMJT}9&uTW6@p4ETJWGZsX0Rift3_oM*NAzMOJJI~C6&N5K8-rU!a`jyfs#cAsI{Ii z+w*1%h#spX)pZ7xAp}8S1)~NesSxZ!)NF-zyFtyN9m-YHRA@H?FR^9b@N>}&B51y~ za@>8idG+&)jrsZaA9hDij+4i){e!0)(ygQ6jpsY}&Ry9)TA{ z_!?e(`R#)H>+I^^?C?bYvK?JI(f{nddZS)gn)fe%{IR+3ZXFVG^V5U3(a-qZ-OZhU D&i~(P literal 0 HcmV?d00001 diff --git a/secrets/secrets.nix b/secrets/secrets.nix index d2a471e..e81aeef 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -23,4 +23,6 @@ in "wireguard-private-key.age".publicKeys = personal; "webis.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ]; "webis-ssh.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ]; + "root-password.age".publicKeys = hosts-personal ++ [ moritz ]; + "moritz-password.age".publicKeys = hosts-personal ++ [ moritz ]; } From 23c7e7727557d893dfe36c26d5999cad6a49e40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 25 Sep 2023 19:41:28 +0200 Subject: [PATCH 13/33] perf: speed up zfs-diff --- hosts/nixos-laptop/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 20c12bd..da26953 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -21,9 +21,20 @@ personal.enable = true; # webis.enable = true; }; - shell.aliases.zfs-diff = "sudo zfs diff zroot/encrypted/root@blank | parallel --pipe cut -f2 | parallel 'test -e /persist/{} || echo {}' | ${lib.getExe pkgs.tree} --fromfile ."; }; + environment.systemPackages = [ + ( + pkgs.writeShellApplication { + name = "zfs-diff"; + runtimeInputs = with pkgs; [ zfs coreutils parallel tree ]; + text = '' + sudo zfs diff zroot/encrypted/root@blank | cut -f2 | parallel 'test -d /persist/{} || echo {}' | tree --fromfile . + ''; + } + ) + ]; + home-manager.users.moritz.home.packages = with pkgs; [ # jetbrains.idea-ultimate ]; From 611584a0beb44b7957bfe03a4322bdfb81284426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 27 Sep 2023 10:38:27 +0200 Subject: [PATCH 14/33] feat(nvim): add nvim-puppeteer for f-strings --- flake.lock | 17 +++++++++++++++++ flake.nix | 3 +++ modules/programs/nvim/plugins/coding.nix | 4 ++++ overlays/vimPlugins.nix | 6 ++++++ 4 files changed, 30 insertions(+) diff --git a/flake.lock b/flake.lock index a3e2659..0168879 100644 --- a/flake.lock +++ b/flake.lock @@ -863,6 +863,22 @@ "type": "github" } }, + "nvim-puppeteer": { + "flake": false, + "locked": { + "lastModified": 1695758417, + "narHash": "sha256-rkaQUOXxNfkib0kPv+z8ncZiwgSP26+jwNtN9ydcvLQ=", + "owner": "chrisgrieser", + "repo": "nvim-puppeteer", + "rev": "9cd2d2e2630db6377538f5f0dccdea3517db2ce1", + "type": "github" + }, + "original": { + "owner": "chrisgrieser", + "repo": "nvim-puppeteer", + "type": "github" + } + }, "nvim-treesitter": { "flake": false, "locked": { @@ -939,6 +955,7 @@ "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", "nixpkgs": "nixpkgs_7", + "nvim-puppeteer": "nvim-puppeteer", "nvim-treesitter": "nvim-treesitter", "pre-commit-hooks": "pre-commit-hooks", "rofi-wayland": "rofi-wayland", diff --git a/flake.nix b/flake.nix index fb57451..475d0cd 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,9 @@ nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim"; + nvim-puppeteer.flake = false; + nvim-puppeteer.url = "github:chrisgrieser/nvim-puppeteer"; + # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; hyprland.url = "github:hyprwm/Hyprland"; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index ae3d393..fc4d22a 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -313,5 +313,9 @@ with builtins; ]; opts = { }; } + { + plugin = nvim-puppeteer; + lazy = false; # NOTE: plugin lazy-loads itself. + } ]; } diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 7cafdf5..cc219b9 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -37,5 +37,11 @@ with lib.my; version = mkVersionInput inputs.nvim-treesitter; src = inputs.nvim-treesitter; }); + + nvim-puppeteer = prev.vimUtils.buildVimPluginFrom2Nix { + pname = "nvim-puppeteer"; + version = mkVersionInput inputs.nvim-puppeteer; + src = inputs.nvim-puppeteer; + }; }; } From e2a0172e2d78e900103063fce15bb313bdb3713a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 27 Sep 2023 12:38:41 +0200 Subject: [PATCH 15/33] feat(flake): use flake-parts --- flake.lock | 222 +++++++++++----- flake.nix | 251 +++++++++--------- hosts/nixos-desktop/default.nix | 57 ++-- .../nixos-desktop/hardware-configuration.nix | 75 +++--- hosts/nixos-desktop/system.nix | 1 - hosts/nixos-laptop/default.nix | 86 +++--- hosts/nixos-laptop/hardware-configuration.nix | 12 +- hosts/nixos-laptop/system.nix | 1 - hosts/scadspc25/default.nix | 17 +- hosts/scadspc25/hardware-configuration.nix | 83 +++--- hosts/scadspc25/system.nix | 1 - modules/profiles/base.nix | 18 -- modules/programs/hyprland/default.nix | 139 +++++----- modules/security/default.nix | 102 +++---- 14 files changed, 576 insertions(+), 489 deletions(-) delete mode 100644 hosts/nixos-desktop/system.nix delete mode 100644 hosts/nixos-laptop/system.nix delete mode 100644 hosts/scadspc25/system.nix diff --git a/flake.lock b/flake.lock index 0168879..159b808 100644 --- a/flake.lock +++ b/flake.lock @@ -93,9 +93,28 @@ "type": "github" } }, + "devshell": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1695195896, + "narHash": "sha256-pq9q7YsGXnQzJFkR5284TmxrLNFc0wo4NQ/a5E93CQU=", + "owner": "numtide", + "repo": "devshell", + "rev": "05d40d17bf3459606316e3e9ec683b784ff28f16", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "disko": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1695380190, @@ -160,6 +179,24 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "neovim-nightly-overlay", @@ -180,9 +217,9 @@ "type": "github" } }, - "flake-parts_2": { + "flake-parts_3": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { "lastModified": 1688466019, @@ -197,7 +234,7 @@ "type": "indirect" } }, - "flake-parts_3": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "neovim-nightly-overlay", @@ -222,7 +259,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1694529238, @@ -240,7 +277,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1685518550, @@ -258,7 +295,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1685518550, @@ -313,9 +350,9 @@ }, "hercules-ci-agent": { "inputs": { - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_4", "haskell-flake": "haskell-flake", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1688568579, @@ -332,7 +369,7 @@ }, "hercules-ci-effects": { "inputs": { - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "hercules-ci-agent": "hercules-ci-agent", "nixpkgs": [ "neovim-nightly-overlay", @@ -412,7 +449,7 @@ }, "hypr-contrib": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1695455081, @@ -431,8 +468,8 @@ "hyprland": { "inputs": { "hyprland-protocols": "hyprland-protocols", - "nixpkgs": "nixpkgs_3", - "systems": "systems_2", + "nixpkgs": "nixpkgs_4", + "systems": "systems_3", "wlroots": "wlroots", "xdph": "xdph" }, @@ -477,7 +514,7 @@ }, "hyprpaper": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1694600309, @@ -588,10 +625,10 @@ "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "hercules-ci-effects": "hercules-ci-effects", "neovim-flake": "neovim-flake", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1695513850, @@ -671,11 +708,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694948089, - "narHash": "sha256-d2B282GmQ9o8klc22/Rbbbj6r99EnELQpOQjWMyv0rU=", + "lastModified": 1677383253, + "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db", + "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", "type": "github" }, "original": { @@ -686,6 +723,24 @@ } }, "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib_2": { "locked": { "dir": "lib", "lastModified": 1688049487, @@ -735,7 +790,39 @@ "type": "github" } }, + "nixpkgs_10": { + "locked": { + "lastModified": 1692934111, + "narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1e44a037bbf4fcaba041436e65e87be88f3f495b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { + "locked": { + "lastModified": 1694948089, + "narHash": "sha256-d2B282GmQ9o8klc22/Rbbbj6r99EnELQpOQjWMyv0rU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1658161305, "narHash": "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=", @@ -751,7 +838,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1694767346, "narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=", @@ -767,7 +854,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1683014792, "narHash": "sha256-6Va9iVtmmsw4raBc3QKvQT2KT/NGRWlvUlJj46zN8B8=", @@ -783,7 +870,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1688322751, "narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=", @@ -799,33 +886,17 @@ "type": "github" } }, - "nixpkgs_6": { - "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_7": { "locked": { "lastModified": 1695318763, "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" @@ -833,15 +904,15 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1689261696, - "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", - "owner": "NixOS", + "lastModified": 1695318763, + "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" @@ -849,11 +920,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1692934111, - "narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=", + "lastModified": 1689261696, + "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1e44a037bbf4fcaba041436e65e87be88f3f495b", + "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", "type": "github" }, "original": { @@ -901,7 +972,7 @@ "flake-compat": "flake-compat_3", "flake-utils": "flake-utils_3", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -941,7 +1012,9 @@ "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", + "devshell": "devshell", "disko": "disko", + "flake-parts": "flake-parts", "flake-utils": "flake-utils", "hmts-nvim": "hmts-nvim", "home-manager": "home-manager_2", @@ -954,7 +1027,7 @@ "nil": "nil", "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "nvim-puppeteer": "nvim-puppeteer", "nvim-treesitter": "nvim-treesitter", "pre-commit-hooks": "pre-commit-hooks", @@ -1039,21 +1112,6 @@ } }, "systems_2": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1068,6 +1126,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "systems_4": { "locked": { "lastModified": 1681028828, @@ -1098,6 +1171,21 @@ "type": "github" } }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "telekasten-nvim": { "flake": false, "locked": { @@ -1133,7 +1221,7 @@ "timers": { "inputs": { "naersk": "naersk", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_10", "utils": "utils" }, "locked": { @@ -1152,7 +1240,7 @@ }, "utils": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1692799911, diff --git a/flake.nix b/flake.nix index 475d0cd..4fab135 100644 --- a/flake.nix +++ b/flake.nix @@ -1,11 +1,6 @@ { description = "My awesome system config"; - /* - ╔══════════════════════════════════════════════════════════╗ - ║ Inputs ║ - ╚══════════════════════════════════════════════════════════╝ - */ inputs = { # Nix master.url = "github:nixos/nixpkgs"; @@ -13,6 +8,8 @@ stable.url = "github:nixos/nixpkgs/nixos-23.05"; flake-utils.url = "github:numtide/flake-utils"; + flake-parts.url = "github:hercules-ci/flake-parts"; + devshell.url = "github:numtide/devshell"; agenix.inputs.nixpkgs.follows = "nixpkgs"; agenix.url = "github:ryantm/agenix"; @@ -20,9 +17,11 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager"; - nil.inputs.flake-utils.follows = "flake-utils"; - nil.inputs.nixpkgs.follows = "nixpkgs"; - nil.url = "github:oxalica/nil"; + nil = { + inputs.flake-utils.follows = "flake-utils"; + inputs.nixpkgs.follows = "nixpkgs"; + url = "github:oxalica/nil"; + }; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; @@ -77,147 +76,141 @@ timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; }; - /* - ╔══════════════════════════════════════════════════════════╗ - ║ Outputs ║ - ╚══════════════════════════════════════════════════════════╝ - */ - outputs = inputs@{ self, nixpkgs, ... }: + outputs = inputs@{ self, flake-parts, ... }: let - systems = [ "x86_64-linux" "aarch64-linux" ]; - - forEachSystem = lib.genAttrs systems; - - lib = nixpkgs.lib.extend - (self: _: { my = import ./lib { lib = self; }; }); - - overlay = import ./overlays { - inherit inputs; - inherit (self) lib; - }; - - config.allowUnfree = true; - - overlays = [ + defaultOverlays = [ inputs.hypr-contrib.overlays.default inputs.neovim-nightly-overlay.overlay - overlay + self.overlay ]; - - pkgsFor = system: import nixpkgs { - inherit system config; - overlays = overlays ++ [ + finalOverlays = + defaultOverlays ++ [ ( _: prev: { master = import inputs.master { inherit (prev) system; - inherit overlays config; + overlays = defaultOverlays; }; stable = import inputs.stable { inherit (prev) system; - inherit overlays config; + overlays = defaultOverlays; }; } ) - overlay ]; - }; - - defaultModules = [ - { nixpkgs = { inherit config; }; } - ./modules - inputs.home-manager.nixosModule - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = { inherit inputs self; }; - sharedModules = [ inputs.nix-lazy-nvim.homeManagerModules.default ]; - }; - } - inputs.agenix.nixosModules.age - inputs.disko.nixosModules.default - inputs.impermanence.nixosModules.impermanence + in + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + inputs.flake-parts.flakeModules.easyOverlay + inputs.pre-commit-hooks.flakeModule + inputs.devshell.flakeModule ]; - hosts = self.lib.my.mapModules - (path: - let - system = import "${path}/system.nix"; - pkgs = pkgsFor system; - in - lib.nixosSystem { - inherit pkgs system lib; - specialArgs = { - inherit inputs self; - }; - modules = defaultModules ++ [ path ]; - }) - ./hosts; + systems = [ "x86_64-linux" ]; + perSystem = { config, self', inputs', pkgs, system, ... }: { + _module.args.pkgs = + import inputs.nixpkgs { + inherit system; + overlays = finalOverlays; + }; - pre-commit-check = system: inputs.pre-commit-hooks.lib."${system}".run { - src = ./.; - hooks = { - nixpkgs-fmt.enable = true; - statix.enable = true; - shellcheck.enable = true; - stylua.enable = true; - }; - }; - in - with lib; { - inherit lib; - - # ╔══════════════════════════════════════════════════════════╗ - # ║ NixOS Configurations ║ - # ╚══════════════════════════════════════════════════════════╝ - - nixosConfigurations = hosts; - - # ╔══════════════════════════════════════════════════════════╗ - # ║ Other Outputs ║ - # ╚══════════════════════════════════════════════════════════╝ - - devShells = forEachSystem (system: - let - pkgs = pkgsFor system; - in - { - default = pkgs.mkShell + devshells.default = { + devshell.startup.pre-commit-hook.text = config.pre-commit.installationScript; + commands = [ { - inherit (pre-commit-check system) shellHook; - name = "dotfiles"; - packages = with pkgs; [ - # Secrets - agenix - # cachix - cachix - ]; - }; - }); - - checks = forEachSystem (system: { - pre-commit-check = pre-commit-check system; - }); - - legacyPackages = forEachSystem pkgsFor; - - packages = forEachSystem (system: - let - pkgs = pkgsFor system; - in - filterAttrs (_: isDerivation) - (overlay pkgs pkgs) - ); - - overlays = - let - overlayNames = attrNames (overlay null null); - mkOverlay = name: final: prev: (overlay final prev).${name}; - in - (genAttrs overlayNames mkOverlay) // { - default = overlay; + name = "agenix"; + help = "wrapper around agenix"; + command = '' + sudo EDITOR="${pkgs.lib.getExe pkgs.vim}" ${pkgs.lib.getExe' inputs'.agenix.packages.default "agenix"} --identity /etc/ssh/ssh_host_ed25519_key "$@" + ''; + } + { + name = "nixos-build"; + help = "use nom to build system"; + command = + '' + nom build --no-link ".#nixosConfigurations.$(hostname).config.system.build.toplevel" $@ + ''; + } + { + name = "nixos-switch"; + help = "wrapper for nixos-rebuild switch"; + command = "sudo nixos-rebuild switch --flake . $@"; + } + { + name = "nixos-test"; + help = "wrapper for nixos-rebuild switch"; + command = "sudo nixos-rebuild test --flake . $@"; + } + { + name = "nixos-boot"; + help = "wrapper for nixos-rebuild switch"; + command = "sudo nixos-rebuild boot --flake . $@"; + } + ]; }; + + pre-commit = { + check.enable = true; + settings = { + hooks = { + nixpkgs-fmt.enable = true; + statix.enable = true; + shellcheck.enable = true; + stylua.enable = true; + }; + }; + }; + + legacyPackages = pkgs; + + packages = + self.lib.filterAttrs (_: self.lib.isDerivation) + (self.overlay pkgs pkgs); + }; + + flake = { + lib = inputs.nixpkgs.lib.extend + (self: _: { my = import ./lib { lib = self; }; }); + + overlay = import ./overlays { + inherit inputs; + inherit (self) lib; + }; + + nixosConfigurations = self.lib.my.mapModules + (path: + self.lib.nixosSystem { + inherit (self) lib; + specialArgs = { + inherit inputs self; + }; + modules = + [ + ./modules + { + nixpkgs = { + overlays = finalOverlays; + config.allowUnfree = true; + }; + } + inputs.home-manager.nixosModule + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs self; }; + sharedModules = [ inputs.nix-lazy-nvim.homeManagerModules.default ]; + }; + } + inputs.agenix.nixosModules.age + inputs.disko.nixosModules.default + inputs.impermanence.nixosModules.impermanence + ] + ++ [ path ]; + }) + ./hosts; + }; }; nixConfig = { diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 7fbb0ce..79984e0 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -31,14 +31,27 @@ home-manager.users.moritz.home.packages = with pkgs; [ jetbrains.idea-community ]; + hardware = { + keyboard.qmk.enable = true; + nvidia.modesetting.enable = true; + opengl = { + enable = true; + driSupport32Bit = true; + driSupport = true; + }; - hardware.keyboard.qmk.enable = true; + # sensors + enableAllFirmware = true; - # KERNEL - boot.kernelPackages = pkgs.linuxPackages_latest; + bluetooth.enable = true; + }; - # BOOT boot = { + # KERNEL + kernelPackages = pkgs.linuxPackages_latest; + + # BOOT + supportedFilesystems = [ "btrfs" "ntfs" ]; loader = { grub = { @@ -49,6 +62,8 @@ }; efi.canTouchEfiVariables = true; }; + + kernelModules = [ "lm92" "drivetemp" ]; }; # NETWORKING @@ -73,33 +88,23 @@ }; networkmanager.enable = true; }; - hardware.nvidia.modesetting.enable = true; - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.opengl = { - enable = true; - driSupport32Bit = true; - driSupport = true; + services = { + xserver.videoDrivers = [ "nvidia" ]; + xserver.xrandrHeads = [ + { output = "HDMI-1"; } + { + output = "HDMI-0"; + primary = true; + } + ]; + + # Powersaving + tlp.enable = true; }; - services.xserver.xrandrHeads = [ - { output = "HDMI-1"; } - { - output = "HDMI-0"; - primary = true; - } - ]; console.keyMap = "de"; - - # Powersaving - services.tlp.enable = true; powerManagement.enable = true; - - # sensors - hardware.enableAllFirmware = true; environment.systemPackages = with pkgs; [ lm_sensors ]; - boot.kernelModules = [ "lm92" "drivetemp" ]; - - hardware.bluetooth.enable = true; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/hosts/nixos-desktop/hardware-configuration.nix b/hosts/nixos-desktop/hardware-configuration.nix index 6ecf64c..75c7ac5 100644 --- a/hosts/nixos-desktop/hardware-configuration.nix +++ b/hosts/nixos-desktop/hardware-configuration.nix @@ -7,51 +7,56 @@ , ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" ]; + boot = { + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + luks.devices."enc".device = "/dev/disk/by-uuid/30025a9f-44cf-4074-8ae2-d4925efd67dd"; + }; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; + fsType = "btrfs"; + options = [ "subvol=root" "compress=zstd" ]; + }; - boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/30025a9f-44cf-4074-8ae2-d4925efd67dd"; + "/home" = { + device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; + fsType = "btrfs"; + options = [ "subvol=home" "compress=zstd" ]; + }; - fileSystems."/home" = { - device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; - fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" ]; - }; + "/nix" = { + device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; + fsType = "btrfs"; + options = [ "subvol=nix" "compress=zstd" ]; + }; - fileSystems."/nix" = { - device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; - fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" ]; - }; + "/var/log" = { + device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; + fsType = "btrfs"; + options = [ "subvol=log" "compress=zstd" ]; + neededForBoot = true; + }; - fileSystems."/var/log" = { - device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1"; - fsType = "btrfs"; - options = [ "subvol=log" "compress=zstd" ]; - neededForBoot = true; - }; + "/boot" = { + device = "/dev/disk/by-uuid/297B-C04C"; + fsType = "vfat"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/297B-C04C"; - fsType = "vfat"; - }; - - fileSystems."/media/games" = { - device = "/dev/disk/by-uuid/8f92ff36-a685-4a67-a3d4-55136dc5f286"; - fsType = "ext4"; + "/media/games" = { + device = "/dev/disk/by-uuid/8f92ff36-a685-4a67-a3d4-55136dc5f286"; + fsType = "ext4"; + }; }; swapDevices = [{ device = "/dev/disk/by-uuid/00ad6f74-f23e-4ac0-abfb-89bdfe5ab8ae"; }]; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/hosts/nixos-desktop/system.nix b/hosts/nixos-desktop/system.nix deleted file mode 100644 index 132026a..0000000 --- a/hosts/nixos-desktop/system.nix +++ /dev/null @@ -1 +0,0 @@ -"x86_64-linux" diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index da26953..350e1f8 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -74,54 +74,56 @@ services.tlp.enable = true; powerManagement.enable = true; - # Hibernare on low battery - systemd.timers.hibernate-on-low-battery = { - wantedBy = [ "multi-user.target" ]; - timerConfig = { - OnUnitActiveSec = "120"; - OnBootSec = "120"; + systemd = { + # Hibernare on low battery + timers.hibernate-on-low-battery = { + wantedBy = [ "multi-user.target" ]; + timerConfig = { + OnUnitActiveSec = "120"; + OnBootSec = "120"; + }; + }; + services.hibernate-on-low-battery = + let + batteryLevelSufficient = + let + batteryPath = "/sys/class/power_supply/BATT"; + in + pkgs.writeShellScriptBin "battery-level-sufficient" '' + test "$(cat ${batteryPath}/status)" != Discharging \ + || test "$(cat ${batteryPath}/capacity)" -ge 5 + ''; + in + { + serviceConfig.Type = "oneshot"; + onFailure = [ "hibernate.target" ]; + script = "${batteryLevelSufficient}/bin/battery-level-sufficient"; + }; + services.asus-touchpad-numpad = { + description = "Activate Numpad inside the touchpad with top right corner switch"; + documentation = [ "https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver" ]; + path = [ pkgs.i2c-tools ]; + script = '' + cd ${inputs.asus-touchpad-numpad-driver} + # In the last argument here you choose your layout. + ${ + pkgs.python3.withPackages (ps: [ps.libevdev]) + }/bin/python asus_touchpad.py m433ia + ''; + # Probably needed because it fails on boot seemingly because the driver + # is not ready yet. Alternativly, you can use `sleep 3` or similar in the + # `script`. + serviceConfig = { + RestartSec = "1s"; + Restart = "on-failure"; + }; + wantedBy = [ "multi-user.target" ]; }; }; - systemd.services.hibernate-on-low-battery = - let - batteryLevelSufficient = - let - batteryPath = "/sys/class/power_supply/BATT"; - in - pkgs.writeShellScriptBin "battery-level-sufficient" '' - test "$(cat ${batteryPath}/status)" != Discharging \ - || test "$(cat ${batteryPath}/capacity)" -ge 5 - ''; - in - { - serviceConfig.Type = "oneshot"; - onFailure = [ "hibernate.target" ]; - script = "${batteryLevelSufficient}/bin/battery-level-sufficient"; - }; # Trackpad # i2c for https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver hardware.i2c.enable = true; - systemd.services.asus-touchpad-numpad = { - description = "Activate Numpad inside the touchpad with top right corner switch"; - documentation = [ "https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver" ]; - path = [ pkgs.i2c-tools ]; - script = '' - cd ${inputs.asus-touchpad-numpad-driver} - # In the last argument here you choose your layout. - ${ - pkgs.python3.withPackages (ps: [ps.libevdev]) - }/bin/python asus_touchpad.py m433ia - ''; - # Probably needed because it fails on boot seemingly because the driver - # is not ready yet. Alternativly, you can use `sleep 3` or similar in the - # `script`. - serviceConfig = { - RestartSec = "1s"; - Restart = "on-failure"; - }; - wantedBy = [ "multi-user.target" ]; - }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/hosts/nixos-laptop/hardware-configuration.nix b/hosts/nixos-laptop/hardware-configuration.nix index 25d25d4..1475b88 100644 --- a/hosts/nixos-laptop/hardware-configuration.nix +++ b/hosts/nixos-laptop/hardware-configuration.nix @@ -2,12 +2,16 @@ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. { modulesPath +, lib , ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + boot = { + initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "rtsx_pci_sdmmc" ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-amd" ]; + extraModulePackages = [ ]; + }; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/hosts/nixos-laptop/system.nix b/hosts/nixos-laptop/system.nix deleted file mode 100644 index 132026a..0000000 --- a/hosts/nixos-laptop/system.nix +++ /dev/null @@ -1 +0,0 @@ -"x86_64-linux" diff --git a/hosts/scadspc25/default.nix b/hosts/scadspc25/default.nix index 6e1633d..c57511a 100644 --- a/hosts/scadspc25/default.nix +++ b/hosts/scadspc25/default.nix @@ -21,12 +21,18 @@ services.synology-drive.enable = true; programs.hyprland.keyboardLayouts = [ "us" "de" ]; }; + boot = { + loader = { + grub = { - # Use the systemd-boot EFI boot loader. - boot.loader.grub.enable = true; - boot.loader.grub.device = "nodev"; - boot.loader.grub.efiSupport = true; - boot.loader.efi.canTouchEfiVariables = true; + # Use the systemd-boot EFI boot loader. + enable = true; + device = "nodev"; + efiSupport = true; + }; + efi.canTouchEfiVariables = true; + }; + }; networking.hostName = "scadspc25"; # Define your hostname. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. @@ -53,4 +59,3 @@ system.stateVersion = "23.05"; # Did you read the comment? } - diff --git a/hosts/scadspc25/hardware-configuration.nix b/hosts/scadspc25/hardware-configuration.nix index d4d8fdb..7e0391f 100644 --- a/hosts/scadspc25/hardware-configuration.nix +++ b/hosts/scadspc25/hardware-configuration.nix @@ -8,52 +8,55 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; + boot = { - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + initrd.kernelModules = [ ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; + fileSystems = { + "/" = + { + device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; + fsType = "btrfs"; + options = [ "subvol=root" "compress=zstd" "noatime" ]; + }; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "noatime" ]; - }; + "/home" = + { + device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; + fsType = "btrfs"; + options = [ "subvol=home" "compress=zstd" "noatime" ]; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; - fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" "noatime" ]; - }; + "/nix" = + { + device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; + fsType = "btrfs"; + options = [ "subvol=nix" "compress=zstd" "noatime" ]; + }; - fileSystems."/nix" = - { - device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; - fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" "noatime" ]; - }; + "/var/log" = + { + device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; + fsType = "btrfs"; + options = [ "subvol=log" "compress=zstd" "noatime" ]; + }; - fileSystems."/var/log" = - { - device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; - fsType = "btrfs"; - options = [ "subvol=log" "compress=zstd" "noatime" ]; - }; + "/snapshots" = + { + device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; + fsType = "btrfs"; + options = [ "subvol=snapshots" "compress=zstd" "noatime" ]; + }; - fileSystems."/snapshots" = - { - device = "/dev/disk/by-uuid/cfc2d232-f833-4ecf-8098-fe805afd390d"; - fsType = "btrfs"; - options = [ "subvol=snapshots" "compress=zstd" "noatime" ]; - }; - - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/3B2B-63DB"; - fsType = "vfat"; - }; + "/boot" = + { + device = "/dev/disk/by-uuid/3B2B-63DB"; + fsType = "vfat"; + }; + }; swapDevices = [{ device = "/dev/disk/by-uuid/c08ff6b6-d6e2-4620-95fc-6c20b04c7363"; }]; diff --git a/hosts/scadspc25/system.nix b/hosts/scadspc25/system.nix deleted file mode 100644 index 132026a..0000000 --- a/hosts/scadspc25/system.nix +++ /dev/null @@ -1 +0,0 @@ -"x86_64-linux" diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index bab1dd9..b0396ca 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -6,21 +6,6 @@ with lib; let - nom-system = pkgs.writeFishApplication { - name = "nom-system"; - runtimeInputs = with pkgs; [ nix-output-monitor ]; - text = /* fish */ '' - nom build --no-link "/home/moritz/.dotfiles#nixosConfigurations.$(hostname).config.system.build.toplevel" $argv - ''; - }; - nom-system-command = name: command: pkgs.writeFishApplication { - inherit name; - runtimeInputs = with pkgs; [ nom-system nix ]; - text = /* fish */ '' - nom-system $argv && ${command} - ''; - }; - f = pkgs.writeFishApplication { name = "f"; runtimeInputs = with pkgs; [ fzf bat ]; @@ -158,9 +143,6 @@ in bottom # nix - (nom-system-command "nixos-boot" "sudo nixos-rebuild boot --flake ~/.dotfiles") - (nom-system-command "nixos-switch" "sudo nixos-rebuild switch --flake ~/.dotfiles") - (nom-system-command "nixos-test" "sudo nixos-rebuild test --flake ~/.dotfiles") nix-output-monitor nixpkgs-fmt which-nix diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 6bbeff6..d363fac 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -53,88 +53,94 @@ in services.dunst.enable = true; }; - # enable home-manager module home-manager.users.moritz = { + # import home-manager module imports = [ inputs.hyprland.homeManagerModules.default ]; + # enable home-manager module wayland.windowManager.hyprland = { enable = true; package = hyprland; recommendedEnvironment = true; extraConfig = import ./_config.nix args; }; - }; - - # add waybar as a status bar - home-manager.users.moritz.programs.waybar = { - enable = true; - - # start using systemd service - systemd = { + # add waybar as a status bar + programs.waybar = { enable = true; - target = "graphical-session.target"; - }; - settings = { - mainBar = { - start_hidden = true; - layer = "top"; - position = "top"; - height = 20; - modules-left = [ "hyprland/workspaces" ]; - modules-center = [ "hyprland/window" ]; - modules-right = [ "hyprland/language" "network" "memory" "cpu" "battery" "clock" ]; + # start using systemd service + systemd = { + enable = true; + target = "graphical-session.target"; + }; + + settings = { + mainBar = { + start_hidden = true; + layer = "top"; + position = "top"; + height = 20; + modules-left = [ "hyprland/workspaces" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ "hyprland/language" "network" "memory" "cpu" "battery" "clock" ]; + }; }; }; - }; - # lock screen after timeout - home-manager.users.moritz.programs.swaylock = { - enable = true; - settings = { - color = "000000"; + # lock screen after timeout + programs.swaylock = { + enable = true; + settings = { + color = "000000"; + }; + }; + services.swayidle = { + enable = true; + events = [ + { + event = "before-sleep"; + command = "${getExe pkgs.swaylock} -fF"; + } + { + event = "lock"; + command = "${getExe pkgs.swaylock} -fF"; + } + ]; + timeouts = + let + lockTimeout = 10; + in + [ + { + timeout = lockTimeout * 60 - 10; + command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; + } + { + timeout = lockTimeout * 60; + command = "${hyprland}/bin/hyprctl dispatch dpms off"; + resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on"; + } + { + timeout = lockTimeout * 60 + 10; + command = "${pkgs.systemd}/bin/loginctl lock-session"; + } + ] ++ optional + (!cfg.nvidiaSupport) # TODO https://github.com/hyprwm/Hyprland/issues/1728 + { + timeout = 30 * 60; + command = "${pkgs.systemd}/bin/systemctl suspend-and-hibernate"; + }; + systemdTarget = "hyprland-session.target"; + }; + + systemd.user.services.nextcloud-client.Service = { + RestartSec = "500ms"; + Restart = "on-failure"; }; }; - home-manager.users.moritz.services.swayidle = { - enable = true; - events = [ - { - event = "before-sleep"; - command = "${getExe pkgs.swaylock} -fF"; - } - { - event = "lock"; - command = "${getExe pkgs.swaylock} -fF"; - } - ]; - timeouts = - let - lockTimeout = 10; - in - [ - { - timeout = lockTimeout * 60 - 10; - command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; - } - { - timeout = lockTimeout * 60; - command = "${hyprland}/bin/hyprctl dispatch dpms off"; - resumeCommand = "${hyprland}/bin/hyprctl dispatch dpms on"; - } - { - timeout = lockTimeout * 60 + 10; - command = "${pkgs.systemd}/bin/loginctl lock-session"; - } - ] ++ optional - (!cfg.nvidiaSupport) # TODO https://github.com/hyprwm/Hyprland/issues/1728 - { - timeout = 30 * 60; - command = "${pkgs.systemd}/bin/systemctl suspend-and-hibernate"; - }; - systemdTarget = "hyprland-session.target"; - }; + # adds pam module for swaylock security.pam.services.swaylock = { }; @@ -151,11 +157,6 @@ in requiredBy = [ "xdg-desktop-portal.service" ]; }; - home-manager.users.moritz.systemd.user.services.nextcloud-client.Service = { - RestartSec = "500ms"; - Restart = "on-failure"; - }; - # add user packages for wayland and hyprland in particular users.users.moritz.packages = with pkgs; [ brightnessctl # control brightness diff --git a/modules/security/default.nix b/modules/security/default.nix index 1e67492..3fcd4fb 100644 --- a/modules/security/default.nix +++ b/modules/security/default.nix @@ -5,62 +5,64 @@ ## System security tweaks # Prevent replacing the running kernel w/o reboot # security.protectKernelImage = lib.mkDefault true; # NOTE disabled for now to enable hibernate + boot = { - # tmpfs = /tmp is mounted in ram. Doing so makes temp file management speedy - # on ssd systems, and volatile! Because it's wiped on reboot. - boot.tmp.useTmpfs = lib.mkDefault true; - # If not using tmpfs, which is naturally purged on reboot, we must clean it - # /tmp ourselves. /tmp should be volatile storage! - boot.tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs); + # tmpfs = /tmp is mounted in ram. Doing so makes temp file management speedy + # on ssd systems, and volatile! Because it's wiped on reboot. + tmp.useTmpfs = lib.mkDefault true; + # If not using tmpfs, which is naturally purged on reboot, we must clean it + # /tmp ourselves. /tmp should be volatile storage! + tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs); - # Fix a security hole in place for backwards compatibility. See desc in - # nixpkgs/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix - boot.loader.systemd-boot.editor = false; + # Fix a security hole in place for backwards compatibility. See desc in + # nixpkgs/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix + loader.systemd-boot.editor = false; - boot.kernel.sysctl = { - # The Magic SysRq key is a key combo that allows users connected to the - # system console of a Linux kernel to perform some low-level commands. - # Disable it, since we don't need it, and is a potential security concern. - "kernel.sysrq" = 0; + kernel.sysctl = { + # The Magic SysRq key is a key combo that allows users connected to the + # system console of a Linux kernel to perform some low-level commands. + # Disable it, since we don't need it, and is a potential security concern. + "kernel.sysrq" = 0; - ## TCP hardening - # Prevent bogus ICMP errors from filling up logs. - "net.ipv4.icmp_ignore_bogus_error_responses" = 1; - # Reverse path filtering causes the kernel to do source validation of - # packets received from all interfaces. This can mitigate IP spoofing. - "net.ipv4.conf.default.rp_filter" = 1; - "net.ipv4.conf.all.rp_filter" = 1; - # Do not accept IP source route packets (we're not a router) - "net.ipv4.conf.all.accept_source_route" = 0; - "net.ipv6.conf.all.accept_source_route" = 0; - # Don't send ICMP redirects (again, we're on a router) - "net.ipv4.conf.all.send_redirects" = 0; - "net.ipv4.conf.default.send_redirects" = 0; - # Refuse ICMP redirects (MITM mitigations) - "net.ipv4.conf.all.accept_redirects" = 0; - "net.ipv4.conf.default.accept_redirects" = 0; - "net.ipv4.conf.all.secure_redirects" = 0; - "net.ipv4.conf.default.secure_redirects" = 0; - "net.ipv6.conf.all.accept_redirects" = 0; - "net.ipv6.conf.default.accept_redirects" = 0; - # Protects against SYN flood attacks - "net.ipv4.tcp_syncookies" = 1; - # Incomplete protection again TIME-WAIT assassination - "net.ipv4.tcp_rfc1337" = 1; - # Log martian packages - "net.ipv4.conf.all.log_martians" = 1; - "net.ipv4.conf.default.log_martians" = 1; + ## TCP hardening + # Prevent bogus ICMP errors from filling up logs. + "net.ipv4.icmp_ignore_bogus_error_responses" = 1; + # Reverse path filtering causes the kernel to do source validation of + # packets received from all interfaces. This can mitigate IP spoofing. + "net.ipv4.conf.default.rp_filter" = 1; + "net.ipv4.conf.all.rp_filter" = 1; + # Do not accept IP source route packets (we're not a router) + "net.ipv4.conf.all.accept_source_route" = 0; + "net.ipv6.conf.all.accept_source_route" = 0; + # Don't send ICMP redirects (again, we're on a router) + "net.ipv4.conf.all.send_redirects" = 0; + "net.ipv4.conf.default.send_redirects" = 0; + # Refuse ICMP redirects (MITM mitigations) + "net.ipv4.conf.all.accept_redirects" = 0; + "net.ipv4.conf.default.accept_redirects" = 0; + "net.ipv4.conf.all.secure_redirects" = 0; + "net.ipv4.conf.default.secure_redirects" = 0; + "net.ipv6.conf.all.accept_redirects" = 0; + "net.ipv6.conf.default.accept_redirects" = 0; + # Protects against SYN flood attacks + "net.ipv4.tcp_syncookies" = 1; + # Incomplete protection again TIME-WAIT assassination + "net.ipv4.tcp_rfc1337" = 1; + # Log martian packages + "net.ipv4.conf.all.log_martians" = 1; + "net.ipv4.conf.default.log_martians" = 1; - ## TCP optimization - # TCP Fast Open is a TCP extension that reduces network latency by packing - # data in the sender’s initial TCP SYN. Setting 3 = enable TCP Fast Open for - # both incoming and outgoing connections: - "net.ipv4.tcp_fastopen" = 3; - # Bufferbloat mitigations + slight improvement in throughput & latency - "net.ipv4.tcp_congestion_control" = "bbr"; - "net.core.default_qdisc" = "cake"; + ## TCP optimization + # TCP Fast Open is a TCP extension that reduces network latency by packing + # data in the sender’s initial TCP SYN. Setting 3 = enable TCP Fast Open for + # both incoming and outgoing connections: + "net.ipv4.tcp_fastopen" = 3; + # Bufferbloat mitigations + slight improvement in throughput & latency + "net.ipv4.tcp_congestion_control" = "bbr"; + "net.core.default_qdisc" = "cake"; + }; + kernelModules = [ "tcp_bbr" ]; }; - boot.kernelModules = [ "tcp_bbr" ]; # So we don't have to do this later... security.acme.acceptTerms = true; From fadee02e6005db4c0fe58afeb3e24242bbde8e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 27 Sep 2023 13:11:07 +0200 Subject: [PATCH 16/33] feat(nvim): use nixd instead of nil --- .nixd.json | 9 +++ flake.lock | 67 +++++-------------- flake.nix | 6 -- modules/programs/nvim/default.nix | 2 +- .../nvim/plugins/lua/nvim-lspconfig.lua | 2 +- overlays/packages.nix | 1 - 6 files changed, 28 insertions(+), 59 deletions(-) create mode 100644 .nixd.json diff --git a/.nixd.json b/.nixd.json new file mode 100644 index 0000000..31ab0e5 --- /dev/null +++ b/.nixd.json @@ -0,0 +1,9 @@ +{ + "options": { + "enable": true, + "target": { + "args": [], + "installable": ".#nixosConfigurations.nixos-desktop.options" + } + } +} diff --git a/flake.lock b/flake.lock index 159b808..4d8dc1b 100644 --- a/flake.lock +++ b/flake.lock @@ -644,30 +644,6 @@ "type": "github" } }, - "nil": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1695485017, - "narHash": "sha256-aQyRBJnT4tftexM/Y3etfOk8tfMFZzt+vSVtL2J0KLY=", - "owner": "oxalica", - "repo": "nil", - "rev": "510bc6e9b41d39c81b9c815065cb5b7e23a2428c", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "nil", - "type": "github" - } - }, "nix-lazy-nvim": { "locked": { "lastModified": 1694868321, @@ -934,6 +910,22 @@ "type": "github" } }, + "nvim-lspconfig": { + "flake": false, + "locked": { + "lastModified": 1695699913, + "narHash": "sha256-9uH3ZpZ7zk/84agbagNxUZL49h+P5j7gew+2h04psvg=", + "owner": "neovim", + "repo": "nvim-lspconfig", + "rev": "bfdf2e91e7297a54bcc09d3e092a12bff69a1cf4", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "nvim-lspconfig", + "type": "github" + } + }, "nvim-puppeteer": { "flake": false, "locked": { @@ -1024,10 +1016,10 @@ "impermanence": "impermanence", "master": "master", "neovim-nightly-overlay": "neovim-nightly-overlay", - "nil": "nil", "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", "nixpkgs": "nixpkgs_8", + "nvim-lspconfig": "nvim-lspconfig", "nvim-puppeteer": "nvim-puppeteer", "nvim-treesitter": "nvim-treesitter", "pre-commit-hooks": "pre-commit-hooks", @@ -1039,31 +1031,6 @@ "timers": "timers" } }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "nil", - "flake-utils" - ], - "nixpkgs": [ - "nil", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1688783586, - "narHash": "sha256-HHaM2hk2azslv1kH8zmQxXo2e7i5cKgzNIuK4yftzB0=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "7a29283cc242c2486fc67f60b431ef708046d176", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "smartcolumn-nvim": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 4fab135..34a44a8 100644 --- a/flake.nix +++ b/flake.nix @@ -17,12 +17,6 @@ home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager"; - nil = { - inputs.flake-utils.follows = "flake-utils"; - inputs.nixpkgs.follows = "nixpkgs"; - url = "github:oxalica/nil"; - }; - pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; nix-super.url = "github:privatevoid-net/nix-super"; diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index bd14433..96e7683 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -33,7 +33,7 @@ in deadnix isort jq - nil + nixd nixpkgs-fmt nodePackages.bash-language-server rustfmt diff --git a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua index 7aa6dd7..20a17ed 100644 --- a/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/lua/nvim-lspconfig.lua @@ -134,7 +134,7 @@ end local servers = { "bashls", - "nil_ls", + "nixd", "pylsp", "ruff_lsp", "typst_lsp", diff --git a/overlays/packages.nix b/overlays/packages.nix index 973523e..be4efad 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -4,7 +4,6 @@ final: prev: { agenix = inputs.agenix.packages.${prev.system}.default; hyprpaper = inputs.hyprpaper.packages.${prev.system}.default; - nil = inputs.nil.packages.${prev.system}.default; nix-super = inputs.nix-super.packages.${prev.system}.default; rofi-wayland = prev.rofi-wayland.overrideAttrs (_: { src = inputs.rofi-wayland; From f612173ddb8c639e873de322c357063b6ae6a2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 27 Sep 2023 13:13:05 +0200 Subject: [PATCH 17/33] fix(nvim): bump nvim-lspconfig --- flake.nix | 3 +++ overlays/vimPlugins.nix | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/flake.nix b/flake.nix index 34a44a8..8999b11 100644 --- a/flake.nix +++ b/flake.nix @@ -54,6 +54,9 @@ nvim-puppeteer.flake = false; nvim-puppeteer.url = "github:chrisgrieser/nvim-puppeteer"; + nvim-lspconfig.flake = false; + nvim-lspconfig.url = "github:neovim/nvim-lspconfig"; + # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; hyprland.url = "github:hyprwm/Hyprland"; diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index cc219b9..9794b9a 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -38,6 +38,12 @@ with lib.my; src = inputs.nvim-treesitter; }); + # HACK: to fix error in nixpkgs version of nvim-lspconfig + nvim-lspconfig = prev.vimPlugins.nvim-lspconfig.overrideAttrs (_: { + version = mkVersionInput inputs.nvim-lspconfig; + src = inputs.nvim-lspconfig; + }); + nvim-puppeteer = prev.vimUtils.buildVimPluginFrom2Nix { pname = "nvim-puppeteer"; version = mkVersionInput inputs.nvim-puppeteer; From b6684e1c313cdcd8b15434f6b414fce7094e1931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 27 Sep 2023 13:29:34 +0200 Subject: [PATCH 18/33] refactor: flake --- flake.nix | 167 ++++++++++++++++++++++++------------------------------ 1 file changed, 75 insertions(+), 92 deletions(-) diff --git a/flake.nix b/flake.nix index 8999b11..ab2a1e1 100644 --- a/flake.nix +++ b/flake.nix @@ -3,59 +3,46 @@ inputs = { # Nix - master.url = "github:nixos/nixpkgs"; - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - stable.url = "github:nixos/nixpkgs/nixos-23.05"; - - flake-utils.url = "github:numtide/flake-utils"; - flake-parts.url = "github:hercules-ci/flake-parts"; - devshell.url = "github:numtide/devshell"; - agenix.inputs.nixpkgs.follows = "nixpkgs"; agenix.url = "github:ryantm/agenix"; - + devshell.url = "github:numtide/devshell"; + disko.url = "github:nix-community/disko"; + flake-parts.url = "github:hercules-ci/flake-parts"; + flake-utils.url = "github:numtide/flake-utils"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.url = "github:nix-community/home-manager"; - - pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; - - nix-super.url = "github:privatevoid-net/nix-super"; - nix-super.inputs.nixpkgs.follows = "stable"; - - rofi-wayland.url = "github:lbonn/rofi/wayland"; - rofi-wayland.flake = false; - - disko.url = "github:nix-community/disko"; impermanence.url = "github:nix-community/impermanence"; + master.url = "github:nixos/nixpkgs"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; + stable.url = "github:nixos/nixpkgs/nixos-23.05"; + + # Programs + nix-super.inputs.nixpkgs.follows = "stable"; + nix-super.url = "github:privatevoid-net/nix-super"; + rofi-wayland.flake = false; + rofi-wayland.url = "github:lbonn/rofi/wayland"; + timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; # Neovim - neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; - - smartcolumn-nvim.flake = false; - smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim"; - - telekasten-nvim.flake = false; - telekasten-nvim.url = "github:renerocksai/telekasten.nvim"; - - telescope-nvim.flake = false; - telescope-nvim.url = "github:nvim-telescope/telescope.nvim"; - - nvim-treesitter.flake = false; - nvim-treesitter.url = "github:nvim-treesitter/nvim-treesitter/v0.9.1"; # NOTE: to fix weird latest issues - - hmts-nvim.flake = false; - hmts-nvim.url = "github:calops/hmts.nvim"; - actions-preview-nvim.flake = false; actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim"; - + hmts-nvim.flake = false; + hmts-nvim.url = "github:calops/hmts.nvim"; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim"; - - nvim-puppeteer.flake = false; - nvim-puppeteer.url = "github:chrisgrieser/nvim-puppeteer"; - nvim-lspconfig.flake = false; nvim-lspconfig.url = "github:neovim/nvim-lspconfig"; + nvim-puppeteer.flake = false; + nvim-puppeteer.url = "github:chrisgrieser/nvim-puppeteer"; + nvim-treesitter.flake = false; + nvim-treesitter.url = "github:nvim-treesitter/nvim-treesitter/v0.9.1"; # NOTE: to fix weird latest issues + smartcolumn-nvim.flake = false; + smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim"; + telekasten-nvim.flake = false; + telekasten-nvim.url = "github:renerocksai/telekasten.nvim"; + telescope-nvim.flake = false; + telescope-nvim.url = "github:nvim-telescope/telescope.nvim"; # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; @@ -69,8 +56,6 @@ # Firefox user.js arkenfox-userjs.url = "github:arkenfox/user.js"; arkenfox-userjs.flake = false; - - timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; }; outputs = inputs@{ self, flake-parts, ... }: @@ -78,27 +63,26 @@ defaultOverlays = [ inputs.hypr-contrib.overlays.default inputs.neovim-nightly-overlay.overlay - self.overlay + self.overlays.default + ]; + + finalOverlays = defaultOverlays ++ [ + ( + _: prev: { + master = import inputs.master { + inherit (prev) system; + overlays = defaultOverlays; + }; + stable = import inputs.stable { + inherit (prev) system; + overlays = defaultOverlays; + }; + } + ) ]; - finalOverlays = - defaultOverlays ++ [ - ( - _: prev: { - master = import inputs.master { - inherit (prev) system; - overlays = defaultOverlays; - }; - stable = import inputs.stable { - inherit (prev) system; - overlays = defaultOverlays; - }; - } - ) - ]; in flake-parts.lib.mkFlake { inherit inputs; } { imports = [ - inputs.flake-parts.flakeModules.easyOverlay inputs.pre-commit-hooks.flakeModule inputs.devshell.flakeModule ]; @@ -163,49 +147,48 @@ packages = self.lib.filterAttrs (_: self.lib.isDerivation) - (self.overlay pkgs pkgs); + (self.overlays.default pkgs pkgs); }; flake = { lib = inputs.nixpkgs.lib.extend (self: _: { my = import ./lib { lib = self; }; }); - overlay = import ./overlays { + overlays.default = import ./overlays { inherit inputs; inherit (self) lib; }; nixosConfigurations = self.lib.my.mapModules - (path: - self.lib.nixosSystem { - inherit (self) lib; - specialArgs = { - inherit inputs self; - }; - modules = - [ - ./modules - { - nixpkgs = { - overlays = finalOverlays; - config.allowUnfree = true; - }; - } - inputs.home-manager.nixosModule - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - extraSpecialArgs = { inherit inputs self; }; - sharedModules = [ inputs.nix-lazy-nvim.homeManagerModules.default ]; - }; - } - inputs.agenix.nixosModules.age - inputs.disko.nixosModules.default - inputs.impermanence.nixosModules.impermanence - ] - ++ [ path ]; - }) + (path: self.lib.nixosSystem { + inherit (self) lib; + specialArgs = { + inherit inputs self; + }; + modules = + [ + ./modules + { + nixpkgs = { + overlays = finalOverlays; + config.allowUnfree = true; + }; + } + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { inherit inputs self; }; + sharedModules = [ inputs.nix-lazy-nvim.homeManagerModules.default ]; + }; + } + inputs.agenix.nixosModules.age + inputs.disko.nixosModules.default + inputs.home-manager.nixosModule + inputs.impermanence.nixosModules.impermanence + path + ]; + }) ./hosts; }; }; From 184243d9455c569e617736e1733602bd711032e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 29 Sep 2023 20:09:55 +0200 Subject: [PATCH 19/33] feat: enable wallpaper service --- modules/programs/hyprland/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 6bbeff6..049e773 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -51,6 +51,7 @@ in }; wallpapers.enable = true; services.dunst.enable = true; + services.wallpaper.enable = true; }; # enable home-manager module From 76fe8827472a717e1ae3aa0d74d7d04d307c0eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 29 Sep 2023 20:42:17 +0200 Subject: [PATCH 20/33] fix: zfs-diff script --- hosts/nixos-laptop/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 350e1f8..71b149a 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -29,7 +29,7 @@ name = "zfs-diff"; runtimeInputs = with pkgs; [ zfs coreutils parallel tree ]; text = '' - sudo zfs diff zroot/encrypted/root@blank | cut -f2 | parallel 'test -d /persist/{} || echo {}' | tree --fromfile . + sudo zfs diff zroot/encrypted/root@blank | cut -f2 | parallel 'test -e /persist/{} || echo {}' | tree --fromfile . ''; } ) From 1a9474a700256df9ba1fe7e675d30885edcf1ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 30 Sep 2023 12:01:48 +0200 Subject: [PATCH 21/33] perf: improve zfs-diff script further --- hosts/nixos-laptop/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 71b149a..5e383ab 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -29,7 +29,7 @@ name = "zfs-diff"; runtimeInputs = with pkgs; [ zfs coreutils parallel tree ]; text = '' - sudo zfs diff zroot/encrypted/root@blank | cut -f2 | parallel 'test -e /persist/{} || echo {}' | tree --fromfile . + zfs diff -F zroot/encrypted/root@blank | awk '$2 == "F" && system("test -e /persist/"$3) != 0 { print $3 }' 2>/dev/null | tree --fromfile . "$@" ''; } ) From b63dbb873a228723a9b148a6d00e7a3c2cc9a11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 30 Sep 2023 12:02:27 +0200 Subject: [PATCH 22/33] fix(impermanence): keep spell files for nvim --- hosts/nixos-laptop/impermanence.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nixos-laptop/impermanence.nix b/hosts/nixos-laptop/impermanence.nix index b5c697a..8652762 100644 --- a/hosts/nixos-laptop/impermanence.nix +++ b/hosts/nixos-laptop/impermanence.nix @@ -38,6 +38,7 @@ ".config/Nextcloud" ".config/keepassxc" ".local/share/direnv" + ".local/share/nvim" ".local/share/zoxide" ".local/state/nvim" ".mozilla" From 21b77e2ad2be46691ac0fc4fd73a6a2f84d2b426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 1 Oct 2023 21:15:49 +0200 Subject: [PATCH 23/33] feat(nvim): switch back to codeium This reverts commit b0f07137811d1df70e1963a1f0a4e6452271a626. --- flake.lock | 86 ++++++++++--------- flake.nix | 5 ++ modules/programs/nvim/plugins/coding.nix | 21 +---- .../programs/nvim/plugins/lua/nvim-cmp.lua | 6 +- overlays/vimPlugins.nix | 2 + 5 files changed, 60 insertions(+), 60 deletions(-) diff --git a/flake.lock b/flake.lock index 4d8dc1b..297db61 100644 --- a/flake.lock +++ b/flake.lock @@ -71,6 +71,29 @@ "type": "github" } }, + "codeium-nvim": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1695327957, + "narHash": "sha256-UsofTHPG8K7UqO0rJGHS2Ecbv+oVOYQ23Zk6SnshfOs=", + "owner": "jcdickinson", + "repo": "codeium.nvim", + "rev": "b65443d114d3c3c9dcc59ecd8a7dbb3a35320607", + "type": "github" + }, + "original": { + "owner": "jcdickinson", + "repo": "codeium.nvim", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -258,15 +281,12 @@ } }, "flake-utils": { - "inputs": { - "systems": "systems_2" - }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -277,7 +297,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_4" + "systems": "systems_3" }, "locked": { "lastModified": 1685518550, @@ -295,7 +315,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1685518550, @@ -469,7 +489,7 @@ "inputs": { "hyprland-protocols": "hyprland-protocols", "nixpkgs": "nixpkgs_4", - "systems": "systems_3", + "systems": "systems_2", "wlroots": "wlroots", "xdph": "xdph" }, @@ -1004,6 +1024,7 @@ "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", + "codeium-nvim": "codeium-nvim", "devshell": "devshell", "disko": "disko", "flake-parts": "flake-parts", @@ -1079,21 +1100,6 @@ } }, "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1108,6 +1114,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_4": { "locked": { "lastModified": 1681028828, @@ -1138,21 +1159,6 @@ "type": "github" } }, - "systems_6": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "telekasten-nvim": { "flake": false, "locked": { @@ -1207,7 +1213,7 @@ }, "utils": { "inputs": { - "systems": "systems_6" + "systems": "systems_5" }, "locked": { "lastModified": 1692799911, diff --git a/flake.nix b/flake.nix index ab2a1e1..e086c52 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,11 @@ # Neovim actions-preview-nvim.flake = false; actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim"; + codeium-nvim = { + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + url = "github:jcdickinson/codeium.nvim"; + }; hmts-nvim.flake = false; hmts-nvim.url = "github:calops/hmts.nvim"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index fc4d22a..9ebf581 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -86,26 +86,13 @@ with builtins; { plugin = cmp-cmdline; } { plugin = cmp-nvim-lsp; } { plugin = cmp_luasnip; } + { + plugin = codeium-nvim; + opts = { }; + } { plugin = friendly-snippets; } { plugin = lspkind-nvim; } { plugin = luasnip; } - { - plugin = copilot-cmp; - opts = { }; - dependencies = [ - { - plugin = copilot-lua; - opts = { - suggestion = { enabled = false; }; - panel = { enabled = false; }; - }; - conf = /* lua */ '' - require("copilot").setup(opts) - vim.cmd("Copilot disable") - ''; - } - ]; - } ]; } { diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index c48297b..975d84a 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -17,7 +17,7 @@ cmp.setup({ maxwidth = 50, -- prevent the popup from showing more than provided characters ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead symbol_map = { - Copilot = "", + Codeium = "", }, }), }, @@ -56,8 +56,8 @@ cmp.setup({ { name = "async_path", priority = 1 }, { name = "buffer", priority = 1 }, { name = "luasnip", priority = 2 }, - { name = "copilot", group_index = 3 }, - { name = "nvim_lsp", priority = 4 }, + { name = "codeium", priority = 3 }, + { name = "nvim_lsp", priority = 3 }, }, }) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 9794b9a..e1e564a 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -4,6 +4,8 @@ _: prev: with lib.my; { vimPlugins = prev.vimPlugins // { + inherit (inputs.codeium-nvim.packages.${prev.system}.vimPlugins) codeium-nvim; + smartcolumn-nvim = prev.vimUtils.buildVimPluginFrom2Nix { pname = "smartcolumn-nvim"; version = mkVersionInput inputs.smartcolumn-nvim; From d943ab8b6dfaca331c2f4f717eb305f1a5a0909b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 4 Oct 2023 15:02:27 +0200 Subject: [PATCH 24/33] feat(tmux): various improvements --- modules/profiles/base.nix | 4 ++++ modules/programs/tmux/default.nix | 4 ++-- modules/programs/tmux/tmux-attach/script.fish | 2 +- .../programs/tmux/tmux-sessionizer/script.fish | 9 ++++++++- overlays/packages.nix | 15 --------------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index b0396ca..e5f4774 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -124,6 +124,10 @@ in "C-l" = "send-keys C-l"; "R" = "source-file $XDG_CONFIG_HOME/tmux/tmux.conf \\; display-message 'Reloaded tmux.conf'"; }; + root = { + "C-f" = "new-window ts"; + "C-a" = "new-window ta"; + }; copy-mode-vi = { "v" = "send -X begin-selection"; "V" = "send -X select-line"; diff --git a/modules/programs/tmux/default.nix b/modules/programs/tmux/default.nix index 6469f96..3f832e3 100644 --- a/modules/programs/tmux/default.nix +++ b/modules/programs/tmux/default.nix @@ -19,14 +19,14 @@ let tmux-sessionizer = pkgs.writeFishApplication { name = "ts"; - runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd fzf1 tmux-switch ]; + runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch ]; text = readFile ./tmux-sessionizer/script.fish; completions = readFile ./tmux-sessionizer/completions.fish; }; tmux-attach = pkgs.writeFishApplication { name = "ta"; - runtimeInputs = with pkgs; [ tmux fzf1 tmux-switch ]; + runtimeInputs = with pkgs; [ tmux tmux-switch ]; text = readFile ./tmux-attach/script.fish; completions = readFile ./tmux-attach/completions.fish; }; diff --git a/modules/programs/tmux/tmux-attach/script.fish b/modules/programs/tmux/tmux-attach/script.fish index 442dec2..1a4ddd6 100644 --- a/modules/programs/tmux/tmux-attach/script.fish +++ b/modules/programs/tmux/tmux-attach/script.fish @@ -1,4 +1,4 @@ -set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf1 $argv) +set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf $argv) if not test -n "$selected" exit 1 end diff --git a/modules/programs/tmux/tmux-sessionizer/script.fish b/modules/programs/tmux/tmux-sessionizer/script.fish index d0ca484..311ec4a 100644 --- a/modules/programs/tmux/tmux-sessionizer/script.fish +++ b/modules/programs/tmux/tmux-sessionizer/script.fish @@ -1,4 +1,11 @@ -set selected (fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | fzf1 $argv) +set pipe (mktemp --dry-run) +mkfifo $pipe + +fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | tee $pipe >/dev/null & +fd . ~/ --min-depth 1 --max-depth 3 --type d | tee $pipe >/dev/null & + +set selected (cat $pipe | fzf $argv) +rm -f "$pipe" set selected_name (basename $selected 2>/dev/null | string replace "." "_") diff --git a/overlays/packages.nix b/overlays/packages.nix index be4efad..b4f2473 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -11,19 +11,4 @@ final: prev: }); timers = inputs.timers.packages.${prev.system}.default; hyprland = inputs.hyprland.packages.${prev.system}.default; - - fzf1 = final.writeShellApplication { - name = "fzf1"; - runtimeInputs = with final; [ coreutils fzf fd ]; - text = '' - #!/usr/bin/env bash - selected=$(fzf --query="$*" -1 < /dev/stdin) - - if [[ -z $selected ]]; then - exit 0 - fi - - echo "$selected" - ''; - }; } From 28961fe11446ac25acaf605768f70d35034b4581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 8 Oct 2023 13:32:42 +0200 Subject: [PATCH 25/33] feat(nvim): update null-ls-nvim --- flake.lock | 17 +++++++++++++++++ flake.nix | 2 ++ modules/programs/nvim/default.nix | 6 ++++++ .../programs/nvim/plugins/lua/null-ls-nvim.lua | 6 ++++++ overlays/vimPlugins.nix | 5 +++++ 5 files changed, 36 insertions(+) diff --git a/flake.lock b/flake.lock index 297db61..926e2e1 100644 --- a/flake.lock +++ b/flake.lock @@ -930,6 +930,22 @@ "type": "github" } }, + "none-ls-nvim": { + "flake": false, + "locked": { + "lastModified": 1696658105, + "narHash": "sha256-4+B2F4ZweWTqXlhSs0jiBaKSv52G4X7p37KHfYl6sPo=", + "owner": "nvimtools", + "repo": "none-ls.nvim", + "rev": "ae339f45590cc421a68de885fc5a3261cc247362", + "type": "github" + }, + "original": { + "owner": "nvimtools", + "repo": "none-ls.nvim", + "type": "github" + } + }, "nvim-lspconfig": { "flake": false, "locked": { @@ -1040,6 +1056,7 @@ "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", "nixpkgs": "nixpkgs_8", + "none-ls-nvim": "none-ls-nvim", "nvim-lspconfig": "nvim-lspconfig", "nvim-puppeteer": "nvim-puppeteer", "nvim-treesitter": "nvim-treesitter", diff --git a/flake.nix b/flake.nix index e086c52..282e8af 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,8 @@ telekasten-nvim.url = "github:renerocksai/telekasten.nvim"; telescope-nvim.flake = false; telescope-nvim.url = "github:nvim-telescope/telescope.nvim"; + none-ls-nvim.flake = false; + none-ls-nvim.url = "github:nvimtools/none-ls.nvim"; # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 96e7683..a7fdfcd 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -30,12 +30,17 @@ in [ alejandra black + checkmake deadnix + dotenv-linter + fish isort jq nixd nixpkgs-fmt nodePackages.bash-language-server + nodePackages.jsonlint + ruff-lsp rustfmt shellcheck shfmt @@ -46,6 +51,7 @@ in typst typst-lsp yamlfmt + yamllint ]; extraLuaConfig = readFile ./options.lua; lazy.enable = true; diff --git a/modules/programs/nvim/plugins/lua/null-ls-nvim.lua b/modules/programs/nvim/plugins/lua/null-ls-nvim.lua index 6701630..32a1f7e 100644 --- a/modules/programs/nvim/plugins/lua/null-ls-nvim.lua +++ b/modules/programs/nvim/plugins/lua/null-ls-nvim.lua @@ -8,9 +8,15 @@ null_ls.setup({ -- Completion null_ls.builtins.completion.spell, -- Diagnostics + null_ls.builtins.diagnostics.checkmake, null_ls.builtins.diagnostics.deadnix, + null_ls.builtins.diagnostics.dotenv_linter, + null_ls.builtins.diagnostics.fish, + null_ls.builtins.diagnostics.jsonlint, null_ls.builtins.diagnostics.shellcheck, null_ls.builtins.diagnostics.statix, + null_ls.builtins.diagnostics.trail_space, + null_ls.builtins.diagnostics.yamllint, }, }) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index e1e564a..dda9ccb 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -51,5 +51,10 @@ with lib.my; version = mkVersionInput inputs.nvim-puppeteer; src = inputs.nvim-puppeteer; }; + + null-ls-nvim = prev.vimPlugins.null-ls-nvim.overrideAttrs (a: { + version = mkVersionInput inputs.none-ls-nvim; + src = inputs.none-ls-nvim; + }); }; } From 1eb008e41e6d9495ad620109a597c7aa62a0108b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 8 Oct 2023 13:33:57 +0200 Subject: [PATCH 26/33] feat(tmux): improve ta, ts and bindings --- modules/profiles/base.nix | 6 ++---- modules/programs/tmux/default.nix | 4 ++-- modules/programs/tmux/tmux-attach/script.fish | 2 +- modules/programs/tmux/tmux-sessionizer/script.fish | 8 ++++---- 4 files changed, 9 insertions(+), 11 deletions(-) mode change 100644 => 100755 modules/programs/tmux/tmux-sessionizer/script.fish diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index e5f4774..44158d7 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -123,10 +123,8 @@ in "|" = "split-window -h"; "C-l" = "send-keys C-l"; "R" = "source-file $XDG_CONFIG_HOME/tmux/tmux.conf \\; display-message 'Reloaded tmux.conf'"; - }; - root = { - "C-f" = "new-window ts"; - "C-a" = "new-window ta"; + "f" = "new-window ts"; + "a" = "new-window ta"; }; copy-mode-vi = { "v" = "send -X begin-selection"; diff --git a/modules/programs/tmux/default.nix b/modules/programs/tmux/default.nix index 3f832e3..67a4d5f 100644 --- a/modules/programs/tmux/default.nix +++ b/modules/programs/tmux/default.nix @@ -19,7 +19,7 @@ let tmux-sessionizer = pkgs.writeFishApplication { name = "ts"; - runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch ]; + runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch gawk ]; text = readFile ./tmux-sessionizer/script.fish; completions = readFile ./tmux-sessionizer/completions.fish; }; @@ -97,7 +97,7 @@ in if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing} if test -z $tmux_autostarted set -x tmux_autostarted true - ts + tmux new -A -s home end end ''; diff --git a/modules/programs/tmux/tmux-attach/script.fish b/modules/programs/tmux/tmux-attach/script.fish index 1a4ddd6..6d1ab79 100644 --- a/modules/programs/tmux/tmux-attach/script.fish +++ b/modules/programs/tmux/tmux-attach/script.fish @@ -1,4 +1,4 @@ -set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf $argv) +set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf --query "$argv") if not test -n "$selected" exit 1 end diff --git a/modules/programs/tmux/tmux-sessionizer/script.fish b/modules/programs/tmux/tmux-sessionizer/script.fish old mode 100644 new mode 100755 index 311ec4a..a5e957b --- a/modules/programs/tmux/tmux-sessionizer/script.fish +++ b/modules/programs/tmux/tmux-sessionizer/script.fish @@ -1,10 +1,10 @@ +#!/usr/bin/env fish set pipe (mktemp --dry-run) mkfifo $pipe -fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | tee $pipe >/dev/null & -fd . ~/ --min-depth 1 --max-depth 3 --type d | tee $pipe >/dev/null & - -set selected (cat $pipe | fzf $argv) +fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec-batch dirname {} | tee $pipe >/dev/null & +fd . ~/ --min-depth 1 --max-depth 3 --type d --exec-batch realpath {} | tee $pipe >/dev/null & +set selected (cat $pipe | awk '!seen[$0]++' | fzf --query "$argv") rm -f "$pipe" set selected_name (basename $selected 2>/dev/null | string replace "." "_") From cb262d4cf54629b58fa15de6357824729a5c49d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 8 Oct 2023 13:34:13 +0200 Subject: [PATCH 27/33] feat(nvim)!: remove lsp-signature-help --- modules/programs/nvim/plugins/coding.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 9ebf581..d0c0856 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -104,7 +104,6 @@ with builtins; event = [ "BufRead" "BufNewFile" ]; conf = readFile ./lua/nvim-lspconfig.lua; dependencies = [ - { plugin = lsp_signature-nvim; } { plugin = null-ls-nvim; conf = readFile ./lua/null-ls-nvim.lua; From 7d54b6d42ba13460048fd4b90af35ddcbf68b038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:50:54 +0200 Subject: [PATCH 28/33] fix: command not found handler --- flake.nix | 3 +++ modules/profiles/base.nix | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index ab2a1e1..73fb310 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,8 @@ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; stable.url = "github:nixos/nixpkgs/nixos-23.05"; + nix-index-database.url = "github:Mic92/nix-index-database"; + nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; # Programs nix-super.inputs.nixpkgs.follows = "stable"; @@ -186,6 +188,7 @@ inputs.disko.nixosModules.default inputs.home-manager.nixosModule inputs.impermanence.nixosModules.impermanence + inputs.nix-index-database.nixosModules.nix-index path ]; }) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index b0396ca..8904931 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -171,8 +171,8 @@ in programs = { mtr.enable = true; - command-not-found.enable = true; starship.enable = true; + command-not-found.enable = false; }; services = { From 1e335c819541750a8b9d1ecc5c5af42f0a5928ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:51:41 +0200 Subject: [PATCH 29/33] feat(firefox): add plugins through nix --- flake.nix | 5 +++++ modules/programs/firefox.nix | 27 +++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 73fb310..db65dad 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; stable.url = "github:nixos/nixpkgs/nixos-23.05"; + nur.url = "github:nix-community/NUR"; nix-index-database.url = "github:Mic92/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; @@ -79,6 +80,10 @@ inherit (prev) system; overlays = defaultOverlays; }; + nur = import inputs.nur { + pkgs = prev; + nurpkgs = prev; + }; } ) ]; diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 8461c47..f1f57e3 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -1,6 +1,7 @@ { config , lib , inputs +, pkgs , ... }: @@ -33,13 +34,27 @@ in config = mkIf cfg.enable { home-manager.users.moritz.programs.firefox = { enable = true; - profiles."default".extraConfig = mkIf cfg.arkenfox.enable '' - // Arkenfox user.js - ${arkenfox} + profiles."default" = { + extraConfig = mkIf cfg.arkenfox.enable '' + // Arkenfox user.js + ${arkenfox} - // Overrides - ${cfg.arkenfox.overrides} - ''; + // Overrides + ${cfg.arkenfox.overrides} + ''; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + darkreader + firefox-color + istilldontcareaboutcookies + kagi-search + keepassxc-browser + languagetool + multi-account-containers + ublock-origin + wikiwand-wikipedia-modernized + vimium + ]; + }; }; }; } From 5a1853ea22de6642dab085abcb2356ad3a013e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:52:14 +0200 Subject: [PATCH 30/33] fix: nix-super issues with v1.18 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index db65dad..8c553e0 100644 --- a/flake.nix +++ b/flake.nix @@ -22,7 +22,7 @@ # Programs nix-super.inputs.nixpkgs.follows = "stable"; - nix-super.url = "github:privatevoid-net/nix-super"; + nix-super.url = "github:privatevoid-net/nix-super/518ce777422c6ade8988a3dd1bebb407a08f3851"; # NOTE: because nix 1.18 is borked rofi-wayland.flake = false; rofi-wayland.url = "github:lbonn/rofi/wayland"; timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git"; From 9f9badff24715c20cb270ededfdf0828c505360b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:53:01 +0200 Subject: [PATCH 31/33] refactor: hyprland module --- modules/programs/hyprland/_config.nix | 2 +- modules/programs/hyprland/default.nix | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 8978830..c27c59d 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -111,10 +111,10 @@ in } misc { - # disable_hypr_chan = true vrr = 1 mouse_move_enables_dpms = true key_press_enables_dpms = true + force_default_wallpaper = 0 } # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 92ddad0..89c19f8 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -55,15 +55,10 @@ in }; home-manager.users.moritz = { - - # import home-manager module - imports = [ inputs.hyprland.homeManagerModules.default ]; - # enable home-manager module wayland.windowManager.hyprland = { enable = true; package = hyprland; - recommendedEnvironment = true; extraConfig = import ./_config.nix args; }; @@ -133,7 +128,7 @@ in timeout = 30 * 60; command = "${pkgs.systemd}/bin/systemctl suspend-and-hibernate"; }; - systemdTarget = "hyprland-session.target"; + systemdTarget = "graphical-session.target"; }; systemd.user.services.nextcloud-client.Service = { @@ -142,19 +137,11 @@ in }; }; - # adds pam module for swaylock security.pam.services.swaylock = { }; - # only consider graphical-session.target started when hyprland-sesstion.target is reached - systemd.user.targets.hyprland-session = { - partOf = [ "graphical-session.target" ]; - wantedBy = [ "graphical-session.target" ]; - before = [ "graphical-session.target" ]; - }; - systemd.user.services.xdg-desktop-portal-hyprland = { - after = [ "hyrpland-session.target" ]; + after = [ "hyprland-session.target" ]; requiredBy = [ "xdg-desktop-portal.service" ]; }; From ea13f39c9f10bd3a0d9d9a63bc702f0e53f8ddf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:53:30 +0200 Subject: [PATCH 32/33] build: bump inputs --- flake.lock | 198 ++++++++++++++++++++++++---------------- overlays/packages.nix | 5 + overlays/vimPlugins.nix | 10 +- 3 files changed, 128 insertions(+), 85 deletions(-) diff --git a/flake.lock b/flake.lock index 4d8dc1b..fdbf8a5 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1695384796, + "lastModified": 1696775529, "narHash": "sha256-TYlE4B0ktPtlJJF9IFxTWrEeq+XKG8Ny0gc2FGEAdj0=", "owner": "ryantm", "repo": "agenix", - "rev": "1f677b3e161d3bdbfd08a939e8f25de2568e0ef4", + "rev": "daf42cb35b2dc614d1551e37f96406e4c4a2d3e4", "type": "github" }, "original": { @@ -41,11 +41,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1695299795, - "narHash": "sha256-rl6WSgyXTbSLXL3ItpbfToSPAS4+rftojSzFWxNuHU4=", + "lastModified": 1696674829, + "narHash": "sha256-t+BQGAghYqDaTE2UdU2t8/oYmebBJ2DRi2GAva5agFw=", "owner": "arkenfox", "repo": "user.js", - "rev": "56f51203bf4fea8aa778b792269205d275a62665", + "rev": "f54d632da585a08185c6164017d79315c331181f", "type": "github" }, "original": { @@ -99,11 +99,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1695195896, - "narHash": "sha256-pq9q7YsGXnQzJFkR5284TmxrLNFc0wo4NQ/a5E93CQU=", + "lastModified": 1695973661, + "narHash": "sha256-BP2H4c42GThPIhERtTpV1yCtwQHYHEKdRu7pjrmQAwo=", "owner": "numtide", "repo": "devshell", - "rev": "05d40d17bf3459606316e3e9ec683b784ff28f16", + "rev": "cd4e2fda3150dd2f689caeac07b7f47df5197c31", "type": "github" }, "original": { @@ -117,11 +117,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1695380190, - "narHash": "sha256-v1TwBU/mKroZZPWYXujAfOHfIaQw44swa50Jgdkr7OE=", + "lastModified": 1696814493, + "narHash": "sha256-1qArVsJGG2RHbV2iKFpAmM5os3myvwpXMOdFy5nh54M=", "owner": "nix-community", "repo": "disko", - "rev": "98a6ab9b52f8b06db9c3116b1761bbeaf9484408", + "rev": "32ce057c183506cecb0b84950e4eaf39f37e8c75", "type": "github" }, "original": { @@ -133,11 +133,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -183,11 +183,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1693611461, - "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "type": "github" }, "original": { @@ -204,11 +204,11 @@ ] }, "locked": { - "lastModified": 1693611461, - "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "type": "github" }, "original": { @@ -377,11 +377,11 @@ ] }, "locked": { - "lastModified": 1689397210, - "narHash": "sha256-fVxZnqxMbsDkB4GzGAs/B41K0wt/e+B/fLxmTFF/S20=", + "lastModified": 1695684520, + "narHash": "sha256-yORqGB0i1OtEf9MOCCT2BIbOd8txPZn216CM+ylMmhY=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "0a63bfa3f00a3775ea3a6722b247880f1ffe91ce", + "rev": "91fae5824f5f1199f61693c6590b4a89abaed9d7", "type": "github" }, "original": { @@ -434,11 +434,11 @@ ] }, "locked": { - "lastModified": 1695550077, - "narHash": "sha256-xoxR/iY69/3lTnnZDP6gf3J46DUKPcf+Y1jH03tfZXE=", + "lastModified": 1696737557, + "narHash": "sha256-YD/pjDjj/BNmisEvRdM/vspkCU3xyyeGVAUWhvVSi5Y=", "owner": "nix-community", "repo": "home-manager", - "rev": "a88df2fb101778bfd98a17556b3a2618c6c66091", + "rev": "3c1d8758ac3f55ab96dcaf4d271c39da4b6e836d", "type": "github" }, "original": { @@ -452,11 +452,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1695455081, - "narHash": "sha256-AtAMze2J5Maol28OLQoCFgppRWEy06Mn9RhduXNmhiI=", + "lastModified": 1696339530, + "narHash": "sha256-rb954Rc+IyUiiXoIuQOJRp0//zH/WeMYZ3yJ5CccODA=", "owner": "hyprwm", "repo": "contrib", - "rev": "33663f663e07b4ca52c9165f74e3d793f08b15e7", + "rev": "2e3f8ac2a3f1334fd2e211b07ed76b4215bb0542", "type": "github" }, "original": { @@ -474,11 +474,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1695558936, - "narHash": "sha256-KcSkwSDlrt3Xwtit+NTu2aToiRm5Aho9joj2r6nb19w=", + "lastModified": 1696891919, + "narHash": "sha256-h7/lmKV5zfJz/4m/oLib7iTqQ7fpfB599AzW2QRoGtg=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "352ceb1117b79cd0bc3fa86ebe435b6909512ddb", + "rev": "8abb6e1cee3e967ff414af0d6a1a31ebced95f5b", "type": "github" }, "original": { @@ -517,11 +517,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1694600309, - "narHash": "sha256-d9LcB+D0bfMu+8UhnUVJ/DX5OVTX6o5dIntdVqEeQDA=", + "lastModified": 1696724955, + "narHash": "sha256-7CczVKotC1RJuSyJMxgzUP11Y1txku9JAga5eFxpA+4=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "e5a18a171d5d6e7c6b9ffdfb9e86fb09055964a1", + "rev": "72735ae6352085ef842f6ed496889115afd76ce4", "type": "github" }, "original": { @@ -563,11 +563,11 @@ }, "master": { "locked": { - "lastModified": 1695566498, - "narHash": "sha256-pitC2KSFFQr0VVWTWrhOYM3JkHMTGJ+n2f3swZNRjq8=", + "lastModified": 1696923230, + "narHash": "sha256-Evn8vdETCSxQH6txfwYIN7N69RKSfZLkN7dSqfnRYRw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "46338210c41bbb92502517cccbb2223973a17a62", + "rev": "906535b6191830a247e004f53d74359a60883ba4", "type": "github" }, "original": { @@ -608,11 +608,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1695509205, - "narHash": "sha256-nV3opNLzLMfzL0yI+xnIeNIOnvOI467CiABxHTQUrwY=", + "lastModified": 1696892794, + "narHash": "sha256-KQ1X1CLjabnnLItHb2zlrSZzj4lQNkdZMx84QWcU9qA=", "owner": "neovim", "repo": "neovim", - "rev": "bc0bf9d030bbcb01db69c44cf88b95ca41dd3065", + "rev": "43f22853fecf312713deed983b9cde1a6bda6ebd", "type": "github" }, "original": { @@ -631,11 +631,11 @@ "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1695513850, - "narHash": "sha256-tzhm05TH22eI+ePzuPHrMgq2sjLkEW1q1E515+VRVuw=", + "lastModified": 1696896059, + "narHash": "sha256-GLJJRb2PSI9Hq1J4D0YVMV6lxHPP2QilEAWeIrEQSEI=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "07c3b00574cb6645d92786c5a5531cb20426785d", + "rev": "4ea129658fe3e7ecaebe574093ed3fe9673b5f6c", "type": "github" }, "original": { @@ -644,6 +644,26 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1696736548, + "narHash": "sha256-Dg0gJ9xVXud55sAbXspMapFYZOpVAldQQo7MFp91Vb0=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "2902dc66f64f733bfb45754e984e958e9fe7faf9", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, "nix-lazy-nvim": { "locked": { "lastModified": 1694868321, @@ -669,16 +689,17 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1695405275, - "narHash": "sha256-R4TX73TAzrW03Rdsa4HNz5ASKx5S1AKa/3SAntUHglg=", + "lastModified": 1685886360, + "narHash": "sha256-mQ6Eryo7CFkt8KHVJcbg0HfXMGFrjMq04XnL9b9TsX0=", "owner": "privatevoid-net", "repo": "nix-super", - "rev": "cae2c834f2a19db35cd46d233f5b59086b24a6f1", + "rev": "518ce777422c6ade8988a3dd1bebb407a08f3851", "type": "github" }, "original": { "owner": "privatevoid-net", "repo": "nix-super", + "rev": "518ce777422c6ade8988a3dd1bebb407a08f3851", "type": "github" } }, @@ -701,11 +722,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1693471703, - "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "lastModified": 1696019113, + "narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a", "type": "github" }, "original": { @@ -784,11 +805,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1694948089, - "narHash": "sha256-d2B282GmQ9o8klc22/Rbbbj6r99EnELQpOQjWMyv0rU=", + "lastModified": 1696725822, + "narHash": "sha256-B7uAOS7TkLlOg1aX01rQlYbydcyB6ZnLJSfaYbKVww8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db", + "rev": "5aabb5780a11c500981993d49ee93cfa6df9307b", "type": "github" }, "original": { @@ -864,11 +885,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "lastModified": 1696757521, + "narHash": "sha256-cfgtLNCBLFx2qOzRLI6DHfqTdfWI+UbvsKYa3b3fvaA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "rev": "2646b294a146df2781b1ca49092450e8a32814e1", "type": "github" }, "original": { @@ -880,11 +901,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "lastModified": 1696757521, + "narHash": "sha256-cfgtLNCBLFx2qOzRLI6DHfqTdfWI+UbvsKYa3b3fvaA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "rev": "2646b294a146df2781b1ca49092450e8a32814e1", "type": "github" }, "original": { @@ -910,14 +931,29 @@ "type": "github" } }, + "nur": { + "locked": { + "lastModified": 1696923989, + "narHash": "sha256-cANE1rSfOb3yxQ+bH7CTXZbj34AnQyzu0g22JDbLUpE=", + "owner": "nix-community", + "repo": "NUR", + "rev": "0268065df586f8cae6b648432ebbda3b5ac96503", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1695699913, - "narHash": "sha256-9uH3ZpZ7zk/84agbagNxUZL49h+P5j7gew+2h04psvg=", + "lastModified": 1696572942, + "narHash": "sha256-i3lDsFwoMddpN1I4t3Fj+Dthyxq7twCgpYuNtlvfI5Y=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "bfdf2e91e7297a54bcc09d3e092a12bff69a1cf4", + "rev": "2b361e043810d5587d9af0787f8ce40da92ec5e9", "type": "github" }, "original": { @@ -929,11 +965,11 @@ "nvim-puppeteer": { "flake": false, "locked": { - "lastModified": 1695758417, - "narHash": "sha256-rkaQUOXxNfkib0kPv+z8ncZiwgSP26+jwNtN9ydcvLQ=", + "lastModified": 1696887151, + "narHash": "sha256-voQru65IC5OM5JVwa1v62O7tmsIdGZJ6BS75lHt0Pxo=", "owner": "chrisgrieser", "repo": "nvim-puppeteer", - "rev": "9cd2d2e2630db6377538f5f0dccdea3517db2ce1", + "rev": "4a2c68b93366eca5bca9e6b71e6cc8d643cfdca5", "type": "github" }, "original": { @@ -968,11 +1004,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1694364351, - "narHash": "sha256-oadhSCqopYXxURwIA6/Anpe5IAG11q2LhvTJNP5zE6o=", + "lastModified": 1696846637, + "narHash": "sha256-0hv4kbXxci2+pxhuXlVgftj/Jq79VSmtAyvfabCCtYk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "4f883a76282bc28eb952570afc3d8a1bf6f481d7", + "rev": "42e1b6095ef80a51f79595d9951eb38e91c4e6ca", "type": "github" }, "original": { @@ -984,11 +1020,11 @@ "rofi-wayland": { "flake": false, "locked": { - "lastModified": 1695513431, + "lastModified": 1695649959, "narHash": "sha256-WG1EyBYTbDsK4RsPgp8K/PlscvRSNthQSyN3cqxuXcc=", "owner": "lbonn", "repo": "rofi", - "rev": "b8dedc8836b552a0bba5f4702be63dd8521c6fbb", + "rev": "9d11a2b4a9095b3f0a092155f749900f7eb8e047", "type": "github" }, "original": { @@ -1016,9 +1052,11 @@ "impermanence": "impermanence", "master": "master", "neovim-nightly-overlay": "neovim-nightly-overlay", + "nix-index-database": "nix-index-database", "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", "nixpkgs": "nixpkgs_8", + "nur": "nur", "nvim-lspconfig": "nvim-lspconfig", "nvim-puppeteer": "nvim-puppeteer", "nvim-treesitter": "nvim-treesitter", @@ -1049,11 +1087,11 @@ }, "stable": { "locked": { - "lastModified": 1695416179, - "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", + "lastModified": 1696697597, + "narHash": "sha256-q26Qv4DQ+h6IeozF2o1secyQG0jt2VUT3V0K58jr3pg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", + "rev": "5a237aecb57296f67276ac9ab296a41c23981f56", "type": "github" }, "original": { @@ -1172,11 +1210,11 @@ "telescope-nvim": { "flake": false, "locked": { - "lastModified": 1695500955, - "narHash": "sha256-Sy4cDVL9HdIj8/UkCnusxACuzA6PKQiuf5Otwtlf8HA=", + "lastModified": 1696709104, + "narHash": "sha256-v68sId4cWHneUaaYp2neVtBobNZo8lsxKoBhRF4yZrI=", "owner": "nvim-telescope", "repo": "telescope.nvim", - "rev": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8", + "rev": "5a747a9587e4bfc4ae086a38cc679fe54f983b69", "type": "github" }, "original": { @@ -1227,18 +1265,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1695277534, - "narHash": "sha256-LEIUGXvKR5DYFQUTavC3yifcObvG4XZUUHfxXmu8nEM=", + "lastModified": 1696410538, + "narHash": "sha256-ecDhdYLXWHsxMv+EWG36mCNDvzRbu9qfjH7dLxL7aGM=", "owner": "wlroots", "repo": "wlroots", - "rev": "98a745d926d8048bc30aef11b421df207a01c279", + "rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "98a745d926d8048bc30aef11b421df207a01c279", + "rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc", "type": "gitlab" } }, diff --git a/overlays/packages.nix b/overlays/packages.nix index be4efad..df04332 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -26,4 +26,9 @@ final: prev: echo "$selected" ''; }; + xorg = prev.xorg // { + lndir = prev.xorg.lndir.overrideAttrs (_: { + meta.mainProgram = "lndir"; + }); + }; } diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 9794b9a..b7b6b8e 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -4,25 +4,25 @@ _: prev: with lib.my; { vimPlugins = prev.vimPlugins // { - smartcolumn-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + smartcolumn-nvim = prev.vimUtils.buildVimPlugin { pname = "smartcolumn-nvim"; version = mkVersionInput inputs.smartcolumn-nvim; src = inputs.smartcolumn-nvim; }; - telekasten-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + telekasten-nvim = prev.vimUtils.buildVimPlugin { pname = "telekasten-nvim"; version = mkVersionInput inputs.telekasten-nvim; src = inputs.telekasten-nvim; }; - hmts-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + hmts-nvim = prev.vimUtils.buildVimPlugin { pname = "hmts-nvim"; version = mkVersionInput inputs.hmts-nvim; src = inputs.hmts-nvim; }; - actions-preview-nvim = prev.vimUtils.buildVimPluginFrom2Nix { + actions-preview-nvim = prev.vimUtils.buildVimPlugin { pname = "actions-preview-nvim"; version = mkVersionInput inputs.actions-preview-nvim; src = inputs.actions-preview-nvim; @@ -44,7 +44,7 @@ with lib.my; src = inputs.nvim-lspconfig; }); - nvim-puppeteer = prev.vimUtils.buildVimPluginFrom2Nix { + nvim-puppeteer = prev.vimUtils.buildVimPlugin { pname = "nvim-puppeteer"; version = mkVersionInput inputs.nvim-puppeteer; src = inputs.nvim-puppeteer; From f051785545868cfd54366c783f8bc0e00649de57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 10 Oct 2023 11:53:47 +0200 Subject: [PATCH 33/33] feat: add kde-connect to impermanence --- hosts/nixos-laptop/impermanence.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nixos-laptop/impermanence.nix b/hosts/nixos-laptop/impermanence.nix index 8652762..798c2df 100644 --- a/hosts/nixos-laptop/impermanence.nix +++ b/hosts/nixos-laptop/impermanence.nix @@ -41,6 +41,7 @@ ".local/share/nvim" ".local/share/zoxide" ".local/state/nvim" + ".config/kdeconnect" ".mozilla" "Documents" "Downloads"