diff --git a/.gitignore b/.gitignore index 93b3e1c..0b33cfd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ result result-* nixos-efi-vars.fd + +home/hosts/work/packages.local.nix diff --git a/dots/.config/nvim/skeletons/shell.nix b/dots/.config/nvim/skeletons/shell.nix index b84b531..ff3704b 100644 --- a/dots/.config/nvim/skeletons/shell.nix +++ b/dots/.config/nvim/skeletons/shell.nix @@ -1,6 +1,4 @@ { pkgs ? import { }, }: -pkgs.mkShell { - nativeBuildInputs = with pkgs.buildPackages; [ ]; -} +pkgs.mkShell { nativeBuildInputs = with pkgs.buildPackages; [ ]; } diff --git a/dots/.config/nvim/snips/typescriptreact.lua b/dots/.config/nvim/snips/typescriptreact.lua new file mode 100644 index 0000000..e674622 --- /dev/null +++ b/dots/.config/nvim/snips/typescriptreact.lua @@ -0,0 +1,12 @@ +local ls = require("luasnip") +local s = ls.snippet +local t = ls.text_node +local i = ls.insert_node + +return { + s("preJ", { + t("
{JSON.stringify("),
+    i(1, "object"), -- first tab stop
+    t(", null, 2)}
"), + }), +} diff --git a/dots/.gitconfig b/dots/.gitconfig index feff57a..7bcce87 100644 --- a/dots/.gitconfig +++ b/dots/.gitconfig @@ -1,9 +1,11 @@ +[include] + path = ~/.gitconfig.email + [core] editor = nvim excludesfile = ~/.gitignore [user] - email = hektor.misplon@pm.me name = Hektor Misplon username = hektor signingKey = AEB98353B8D72E465C4236435151AF79E723F21C @@ -76,8 +78,6 @@ [merge] tool = nvimdiff conflictstyle = diff3 -[pull] - rebase = true [diff] colorMoved = zebra [commit] @@ -85,3 +85,11 @@ [interactive] singleKey = true + +[pull] + rebase = true +[rerere] + enabled = true + +[includeIf "gitdir:~/work/"] + path = ~/.gitconfig.work diff --git a/dots/.gitconfig.email.example b/dots/.gitconfig.email.example new file mode 100644 index 0000000..acd2388 --- /dev/null +++ b/dots/.gitconfig.email.example @@ -0,0 +1,2 @@ +[user] + email = your.email@example.com diff --git a/dots/.gitconfig.work b/dots/.gitconfig.work new file mode 100644 index 0000000..4878c22 --- /dev/null +++ b/dots/.gitconfig.work @@ -0,0 +1,13 @@ +[include] + path = ~/.gitconfig.work.email + +[core] + longpaths = true + +[user] + name = Hektor Misplon + username = hektor.misplon + signingKey = 1C88BE828184CEE6 + +[commit] + gpgsign = false diff --git a/dots/.gitconfig.work.email.example b/dots/.gitconfig.work.email.example new file mode 100644 index 0000000..d6c0105 --- /dev/null +++ b/dots/.gitconfig.work.email.example @@ -0,0 +1,2 @@ +[user] + email = your.work.email@example.com diff --git a/flake.lock b/flake.lock index 4948d59..b0c770c 100644 --- a/flake.lock +++ b/flake.lock @@ -29,11 +29,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1763885608, - "narHash": "sha256-eFRbKKMaEHC5EaL7sxfPVFPFsr0Plzx03e1VkJkcsBA=", + "lastModified": 1764561884, + "narHash": "sha256-vQ3iFPPhxsLqV3c5kgmYP53mVD6id6gsP0tN+oTmqok=", "owner": "rycee", "repo": "nur-expressions", - "rev": "c94982d5890f4ff0737d57ed97503c1c8d40195c", + "rev": "aba4621459aec251d90d6452e3495b58a8a5e185", "type": "gitlab" }, "original": { @@ -68,16 +68,15 @@ ] }, "locked": { - "lastModified": 1758463745, - "narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=", + "lastModified": 1764544324, + "narHash": "sha256-GVBGjO7UsmzLrlOJV8NlKSxukHaHencrJqWkCA6FkqI=", "owner": "nix-community", "repo": "home-manager", - "rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3", + "rev": "e4e25a8c310fa45f2a8339c7972dc43d2845a612", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.05", "repo": "home-manager", "type": "github" } @@ -85,10 +84,10 @@ "nix-secrets": { "flake": false, "locked": { - "lastModified": 1763919406, - "narHash": "sha256-WaGxnH7dm63syPt8E4MXbg4XVxQveXPe+cZu3iPz25w=", + "lastModified": 1764371082, + "narHash": "sha256-yxFxEKXFuXFyFIDZY1gla2OyuqcIE3uT8KDDgTmm3cE=", "ref": "main", - "rev": "4423bf215047474ecb89f4d8ad63a04e734b252a", + "rev": "b9c2ce32cc4c95d7ff01372faea2668407ef8d27", "shallow": true, "type": "git", "url": "ssh://git@github.com/hektor/nix-secrets" @@ -102,11 +101,11 @@ }, "nixCats": { "locked": { - "lastModified": 1763330129, - "narHash": "sha256-KbOeWIF52SV53BOeETGO2C5ewaV2Ex9iaXH7G72gOr8=", + "lastModified": 1764009888, + "narHash": "sha256-hJekfTiW1792txgRSM4LcHnz1lDSY87LYbsJEn2V378=", "owner": "BirdeeHub", "repo": "nixCats-nvim", - "rev": "c81551ed87db2aefab30a12cf7425ff94dc0ad64", + "rev": "16ac3281f322ea15d39843829e42a44d22da3715", "type": "github" }, "original": { @@ -138,11 +137,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1762847253, - "narHash": "sha256-BWWnUUT01lPwCWUvS0p6Px5UOBFeXJ8jR+ZdLX8IbrU=", + "lastModified": 1764440730, + "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "899dc449bc6428b9ee6b3b8f771ca2b0ef945ab9", + "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3", "type": "github" }, "original": { @@ -154,16 +153,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1763622513, - "narHash": "sha256-1jQnuyu82FpiSxowrF/iFK6Toh9BYprfDqfs4BB+19M=", + "lastModified": 1764517877, + "narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c58bc7f5459328e4afac201c5c4feb7c818d604b", + "rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-25.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -324,11 +323,11 @@ ] }, "locked": { - "lastModified": 1763870012, - "narHash": "sha256-AHxFfIu73SpNLAOZbu/AvpLhZ/Szhx6gRPj9ufZtaZA=", + "lastModified": 1764483358, + "narHash": "sha256-EyyvCzXoHrbL467YSsQBTWWg4sR96MH1sPpKoSOelB4=", "owner": "Mic92", "repo": "sops-nix", - "rev": "4e7d74d92398b933cc0e0e25af5b0836efcfdde3", + "rev": "5aca6ff67264321d47856a2ed183729271107c9c", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index f360d1a..e0b3ce6 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { nixpkgs = { - url = "github:nixos/nixpkgs?ref=nixos-25.05"; + url = "github:nixos/nixpkgs/nixos-unstable"; }; nixos-hardware = { url = "github:NixOS/nixos-hardware/master"; @@ -20,7 +20,7 @@ flake = false; }; home-manager = { - url = "github:nix-community/home-manager/release-25.05"; + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; nixgl = { @@ -61,7 +61,9 @@ }; in { - nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; # + nix.nixPath = [ + "nixpkgs=${inputs.nixpkgs}" + ]; # nixosConfigurations = lib.genAttrs hostDirNames ( host: nixpkgs.lib.nixosSystem { @@ -73,9 +75,7 @@ work = home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [ ./home/hosts/work ]; - extraSpecialArgs = { - inherit inputs; - }; + extraSpecialArgs = { inherit inputs; }; }; }; }; diff --git a/home/hosts/astyanax/default.nix b/home/hosts/astyanax/default.nix index 68f836d..e99be13 100644 --- a/home/hosts/astyanax/default.nix +++ b/home/hosts/astyanax/default.nix @@ -12,6 +12,7 @@ in imports = [ ../../modules/dconf.nix # TODO: Only enable when on Gnome? ../../modules/git.nix + ../../modules/k9s.nix (import ../../modules/taskwarrior.nix { inherit config; inherit pkgs; diff --git a/home/hosts/astyanax/packages.nix b/home/hosts/astyanax/packages.nix index 48acd78..c0a3b3f 100644 --- a/home/hosts/astyanax/packages.nix +++ b/home/hosts/astyanax/packages.nix @@ -22,7 +22,6 @@ with pkgs; nixfmt-rfc-style nmap nodejs_24 - nodePackages.ts-node nvimpager ormolu pandoc diff --git a/home/hosts/work/default.nix b/home/hosts/work/default.nix index c1be3e0..9455126 100644 --- a/home/hosts/work/default.nix +++ b/home/hosts/work/default.nix @@ -10,38 +10,37 @@ let in { imports = [ - ../../modules/dconf.nix # TODO: Only enable when on Gnome? + ../../modules/dconf.nix + ../../modules/git.nix + ../../modules/k9s.nix ]; + nixpkgs.config.allowUnfree = true; + home.stateVersion = "25.05"; home.username = username; home.homeDirectory = "/home/${username}"; - sops = { - defaultSopsFile = "${builtins.toString inputs.nix-secrets}/secrets.yaml"; - defaultSopsFormat = "yaml"; - age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; - - secrets."test" = { }; - }; - - nixGL = { + targets.genericLinux.nixGL = { packages = inputs.nixgl.packages; defaultWrapper = "mesa"; }; programs = { - anki = import ../../modules/anki.nix; + # editorconfig.enable = true; firefox = import ../../modules/firefox.nix { inherit inputs; inherit pkgs; inherit config; }; - git = import ../../modules/git.nix; + gh.enable = true; keepassxc = import ../../modules/keepassxc.nix; + kubecolor.enable = true; }; + home.packages = import ./packages.nix { - inherit pkgs; + inherit inputs; inherit config; + inherit pkgs; }; } diff --git a/home/hosts/work/packages.nix b/home/hosts/work/packages.nix index eb5f947..5e9efae 100644 --- a/home/hosts/work/packages.nix +++ b/home/hosts/work/packages.nix @@ -1,4 +1,19 @@ -{ pkgs, config, ... }: +{ + inputs, + config, + pkgs, + ... +}: -with pkgs; -[ ] +let + localPackages = + if builtins.pathExists ./packages.local.nix then + import ./packages.local.nix { inherit inputs config pkgs; } + else + [ ]; +in + +(with pkgs; [ + inputs.nvim.packages.x86_64-linux.nvim +]) +++ localPackages diff --git a/home/modules/anki.nix b/home/modules/anki.nix index 7dc2601..c39f60f 100644 --- a/home/modules/anki.nix +++ b/home/modules/anki.nix @@ -1,3 +1,6 @@ { enable = true; + # sync = { + # username = config.sops.secrets."email/personal".path; + # }; } diff --git a/home/modules/dconf.nix b/home/modules/dconf.nix index 5caaff9..2939ac0 100644 --- a/home/modules/dconf.nix +++ b/home/modules/dconf.nix @@ -7,5 +7,107 @@ "org/gnome/desktop/interface" = { color-scheme = "prefer-dark"; }; + + "org/gnome/desktop/applications/terminal" = { + exec = "kitty"; + exec-arg = ""; + }; + + "org/gnome/desktop/background" = { + color-shading-type = "solid"; + picture-opacity = 100; + picture-options = "zoom"; + picture-uri = "none"; + picture-uri-dark = "none"; + primary-color = "#555555"; + secondary-color = "#555555"; + show-desktop-icons = false; + }; + + # "org/gnome/desktop/input-sources" = { + # sources = [ + # (mkTuple [ + # "xkb" + # "us" + # ]) + # ]; + # xkb-options = [ "caps:none" ]; + # }; + + "org/gnome/desktop/wm/keybindings" = { + close = [ "Delete" ]; + cycle-group = [ ]; + cycle-group-backward = [ ]; + cycle-panels = [ ]; + cycle-panels-backward = [ ]; + cycle-windows = [ ]; + cycle-windows-backward = [ ]; + maximize = [ " " ]; + minimize = [ ]; + move-to-workspace-1 = [ "a" ]; + move-to-workspace-2 = [ "s" ]; + move-to-workspace-3 = [ "d" ]; + move-to-workspace-4 = [ "f" ]; + move-to-workspace-5 = [ "g" ]; + move-to-workspace-last = [ ]; + move-to-workspace-left = [ "h" ]; + move-to-workspace-right = [ "l" ]; + panel-run-dialog = [ ]; + switch-applications = [ "j" ]; + switch-applications-backward = [ "k" ]; + switch-group = [ ]; + switch-group-backward = [ ]; + switch-input-source = [ ]; + switch-input-source-backward = [ ]; + switch-panels = [ ]; + switch-panels-backward = [ ]; + switch-to-workspace-1 = [ "a" ]; + switch-to-workspace-2 = [ "s" ]; + switch-to-workspace-3 = [ "d" ]; + switch-to-workspace-4 = [ "f" ]; + switch-to-workspace-5 = [ "g" ]; + switch-to-workspace-last = [ ]; + switch-to-workspace-left = [ "h" ]; + switch-to-workspace-right = [ "l" ]; + switch-windows = [ ]; + switch-windows-backward = [ ]; + toggle-maximized = [ "space" ]; + unmaximize = [ ]; + }; + + "org/gnome/desktop/wm/preferences" = { + num-workspaces = 5; + workspace-names = [ + "sh" + "www" + "dev" + "info" + "etc" + ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" + ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "Print"; + command = "flameshot gui"; + name = "flameshot"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = "Return"; + command = "kitty"; + name = "Kitty"; + }; + + "org/gnome/shell/keybindings" = { + screenshot = [ "Print" ]; + toggle-application-view = [ "p" ]; + toggle-quick-settings = [ ]; + }; }; } diff --git a/home/modules/git.nix b/home/modules/git.nix index 7f1c33b..00634b5 100644 --- a/home/modules/git.nix +++ b/home/modules/git.nix @@ -2,6 +2,7 @@ programs.git.enable = true; home.file = { ".gitconfig".source = ../../dots/.gitconfig; + ".gitconfig.work".source = ../../dots/.gitconfig.work; ".gitignore".source = ../../dots/.gitignore; }; } diff --git a/home/modules/k9s.nix b/home/modules/k9s.nix new file mode 100644 index 0000000..914d9c2 --- /dev/null +++ b/home/modules/k9s.nix @@ -0,0 +1,11 @@ +{ + programs.k9s = { + enable = true; + settings.k9s = { + ui = { + logoless = true; + reactive = true; + }; + }; + }; +} diff --git a/hosts/andromache/default.nix b/hosts/andromache/default.nix index f2fc158..7943e09 100644 --- a/hosts/andromache/default.nix +++ b/hosts/andromache/default.nix @@ -10,9 +10,8 @@ let username = "h"; in { - system.stateVersion = "25.05"; - imports = [ + ../../modules/common.nix inputs.disko.nixosModules.disko inputs.sops-nix.nixosModules.sops inputs.home-manager.nixosModules.default @@ -78,13 +77,6 @@ in environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - nixpkgs.config.allowUnfree = true; - home-manager = { useGlobalPkgs = true; useUserPackages = true; diff --git a/hosts/andromache/hard.nix b/hosts/andromache/hard.nix index 8a19891..2171ce2 100644 --- a/hosts/andromache/hard.nix +++ b/hosts/andromache/hard.nix @@ -1,14 +1,29 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "uas" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "vmd" + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "uas" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; diff --git a/hosts/astyanax/default.nix b/hosts/astyanax/default.nix index f3d787e..2891a4b 100644 --- a/hosts/astyanax/default.nix +++ b/hosts/astyanax/default.nix @@ -8,12 +8,11 @@ let username = "h"; - hostName = "astynanax"; + hostName = "astyanax"; in { - system.stateVersion = "25.05"; - imports = [ + ../../modules/common.nix inputs.nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel inputs.disko.nixosModules.disko inputs.sops-nix.nixosModules.sops @@ -46,13 +45,6 @@ in environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - nixpkgs.config.allowUnfree = true; - home-manager = { useGlobalPkgs = true; useUserPackages = true; diff --git a/hosts/vm/default.nix b/hosts/vm/default.nix index 53aac18..2067242 100644 --- a/hosts/vm/default.nix +++ b/hosts/vm/default.nix @@ -10,9 +10,8 @@ let username = "h"; in { - system.stateVersion = "25.05"; - imports = [ + ../../modules/common.nix inputs.disko.nixosModules.disko inputs.sops-nix.nixosModules.sops inputs.home-manager.nixosModules.default @@ -38,13 +37,6 @@ in environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nvim ]; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - nixpkgs.config.allowUnfree = true; - disko = { devices.disk.main.device = "/dev/vda"; devices.disk.main.imageName = "nixos-vm"; diff --git a/modules/common.nix b/modules/common.nix new file mode 100644 index 0000000..db24448 --- /dev/null +++ b/modules/common.nix @@ -0,0 +1,10 @@ +{ + system.stateVersion = "25.05"; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + nixpkgs.config.allowUnfree = true; +} diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix index 1b973ae..e965f0c 100644 --- a/modules/secrets/default.nix +++ b/modules/secrets/default.nix @@ -25,6 +25,8 @@ in "taskwarrior_sync_server_url".owner = config.users.users.${cfg.username}.name; "taskwarrior_sync_server_client_id".owner = config.users.users.${cfg.username}.name; "taskwarrior_sync_encryption_secret".owner = config.users.users.${cfg.username}.name; + "email_personal".owner = config.users.users.${cfg.username}.name; + "email_work".owner = config.users.users.${cfg.username}.name; }; templates."taskrc.d/sync" = { @@ -35,6 +37,24 @@ in sync.encryption_secret=${config.sops.placeholder."taskwarrior_sync_encryption_secret"} ''; }; + + templates.".gitconfig.email" = { + owner = config.users.users.${cfg.username}.name; + path = "/home/${cfg.username}/.gitconfig.email"; + content = '' + [user] + email = ${config.sops.placeholder."email_personal"} + ''; + }; + + templates.".gitconfig.work.email" = { + owner = config.users.users.${cfg.username}.name; + path = "/home/${cfg.username}/.gitconfig.work.email"; + content = '' + [user] + email = ${config.sops.placeholder."email_work"} + ''; + }; }; }; }