diff --git a/flake.lock b/flake.lock index 18bc38a..2f78082 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "catppuccin": { "locked": { - "lastModified": 1722661201, - "narHash": "sha256-2JX3S1hmmUhHuyGyGWnaM4xT0SiaDdVkNzmBrEowwK0=", + "lastModified": 1724156255, + "narHash": "sha256-rpUCeS/QZwQdJmDrvCm0hRi8bFvQNQKAnIMK5ZDBfpM=", "owner": "catppuccin", "repo": "nix", - "rev": "19a0f144f0204a12a89243363efb6a493b8cfc83", + "rev": "8886a68edadb1d93c7101337f995ffce4b410ff2", "type": "github" }, "original": { @@ -42,6 +42,28 @@ "type": "github" } }, + "devshell": { + "inputs": { + "nixpkgs": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "owner": "numtide", + "repo": "devshell", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -59,6 +81,20 @@ } }, "flake-compat_2": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1696426674, @@ -74,6 +110,46 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -92,6 +168,80 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "my-nixvim", + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723803910, + "narHash": "sha256-yezvUuFiEnCFbGuwj/bQcqg7RykIEqudOy/RBrId0pc=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "bfef0ada09e2c8ac55bbcd0831bd0c9d42e651ba", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "my-nixvim", + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -99,11 +249,11 @@ ] }, "locked": { - "lastModified": 1722630065, - "narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=", + "lastModified": 1723986931, + "narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=", "owner": "nix-community", "repo": "home-manager", - "rev": "afc892db74d65042031a093adb6010c4c3378422", + "rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671", "type": "github" }, "original": { @@ -112,6 +262,72 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723986931, + "narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "my-nixvim": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "nixvim": "nixvim" + }, + "locked": { + "lastModified": 1724158316, + "narHash": "sha256-cz2N0vPfe0jmjxqKWh7dgVecLqmPLHQrvxGJk0atDbg=", + "ref": "refs/heads/master", + "rev": "a5eb7fe89ee8ba654f339d8f75cecb39851743ec", + "revCount": 4, + "type": "git", + "url": "https://git.xinyang.life/xin/nixvim" + }, + "original": { + "type": "git", + "url": "https://git.xinyang.life/xin/nixvim" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723859949, + "narHash": "sha256-kiaGz4deGYKMjJPOji/JVvSP/eTefrIA3rAjOnOpXl4=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "076b9a905af8a52b866c8db068d6da475839d97b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -119,11 +335,11 @@ ] }, "locked": { - "lastModified": 1722740924, - "narHash": "sha256-UQPgA5d8azLZuDHZMPmvDszhuKF1Ek89SrTRtqsQ4Ss=", + "lastModified": 1723950649, + "narHash": "sha256-dHMkGjwwCGj0c2MKyCjRXVBXq2Sz3TWbbM23AS7/5Hc=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "97ca0a0fca0391de835f57e44f369a283e37890f", + "rev": "392828aafbed62a6ea6ccab13728df2e67481805", "type": "github" }, "original": { @@ -134,7 +350,7 @@ }, "nix-vscode-extensions": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-utils": [ "flake-utils" ], @@ -143,11 +359,11 @@ ] }, "locked": { - "lastModified": 1722821408, - "narHash": "sha256-FMCo35ZmMfvAcae+9neKfu6QzXjU3WL6vW2OFMXx6wI=", + "lastModified": 1724117347, + "narHash": "sha256-/nfm6P0owPtCRjT8ktq/8OChtg2HpkrvNaDJGm9N1Lk=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "f25962fbd632afea744dc7e6868f24d2e73ccedb", + "rev": "2ef60116ef361d988317cbe52a09acfeda7d3416", "type": "github" }, "original": { @@ -158,11 +374,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1722332872, - "narHash": "sha256-2xLM4sc5QBfi0U/AANJAW21Bj4ZX479MHPMPkB+eKBU=", + "lastModified": 1724067415, + "narHash": "sha256-WJBAEFXAtA41RMpK8mvw0cQ62CJkNMBtzcEeNIJV7b0=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "14c333162ba53c02853add87a0000cbd7aa230c2", + "rev": "b09c46430ffcf18d575acf5c339b38ac4e1db5d2", "type": "github" }, "original": { @@ -174,27 +390,39 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722578639, - "narHash": "sha256-yge4OI8r8JBFtoajezauguXwYJ7M+Enwb3ZGbJF4YKA=", - "owner": "xinyangli", + "lastModified": 1723991338, + "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "4c71f761584bd9f9a4c4ba090c353c7f3e65c430", + "rev": "8a3354191c0d7144db9756a74755672387b702ba", "type": "github" }, "original": { - "owner": "xinyangli", - "ref": "deploy", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1722555339, + "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" + } + }, "nixpkgs-stable": { "locked": { - "lastModified": 1722651103, - "narHash": "sha256-IRiJA0NVAoyaZeKZluwfb2DoTpBAj+FLI0KfybBeDU0=", + "lastModified": 1723938990, + "narHash": "sha256-9tUadhnZQbWIiYVXH8ncfGXGvkNq3Hag4RCBEMUk7MI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a633d89c6dc9a2a8aae11813a62d7c58b2c0cc51", + "rev": "c42fcfbdfeae23e68fc520f9182dde9f38ad1890", "type": "github" }, "original": { @@ -220,13 +448,55 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1723173329, + "narHash": "sha256-r8lB8vNn0dEBD7opds4REPS4eDChcOz6ZWit4DTiSU8=", + "owner": "xinyangli", + "repo": "nixpkgs", + "rev": "e3fa5a239ae55cc330f8a54ed3c0738e1bcfa301", + "type": "github" + }, + "original": { + "owner": "xinyangli", + "ref": "deploy", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_2", + "git-hooks": "git-hooks", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs", + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1724127528, + "narHash": "sha256-fKtsvNQeLhPuz1O53x6Xxkd/yYecpolNXRq7mfvnXQk=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "cb413995e1e101c76d755b7f131ce60c7ea3985d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, "nur": { "locked": { - "lastModified": 1722859145, - "narHash": "sha256-Y0X6yzkq5hU/A8MlC9/DfMz1i6mXEauD9539xUkEvo8=", + "lastModified": 1724150696, + "narHash": "sha256-FXuWhg5wD9uFaG/cBazHjmp1Gmd3rZswjaca8FqHQLU=", "owner": "nix-community", "repo": "NUR", - "rev": "ef567c82705d29b0b32d63ffd006c56c92953f4d", + "rev": "ea4eb7133060e7f2079f3cc3213c6200eafc7253", "type": "github" }, "original": { @@ -235,16 +505,40 @@ "type": "github" } }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723969429, + "narHash": "sha256-BuewfNEXEf11MIkJY+uvWsdLu1dIvgJqntWChvNdALg=", + "owner": "NuschtOS", + "repo": "search", + "rev": "a05d1805f2a2bc47d230e5e92aecbf69f784f3d0", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "root": { "inputs": { "catppuccin": "catppuccin", "colmena": "colmena", "flake-utils": "flake-utils", "home-manager": "home-manager", + "my-nixvim": "my-nixvim", "nix-index-database": "nix-index-database", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable", "nur": "nur", "sops-nix": "sops-nix" @@ -258,11 +552,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1722114803, - "narHash": "sha256-s6YhI8UHwQvO4cIFLwl1wZ1eS5Cuuw7ld2VzUchdFP0=", + "lastModified": 1723501126, + "narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "eb34eb588132d653e4c4925d862f1e5a227cc2ab", + "rev": "be0eec2d27563590194a9206f551a6f73d52fa34", "type": "github" }, "original": { @@ -285,6 +579,43 @@ "repo": "default", "type": "github" } + }, + "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" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "my-nixvim", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723808491, + "narHash": "sha256-rhis3qNuGmJmYC/okT7Dkc4M8CeUuRCSvW6kC2f3hBc=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1d07739554fdc4f8481068f1b11d6ab4c1a4167a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index c2ba7c6..61a65a3 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + my-nixvim = { + url = "git+https://git.xinyang.life/xin/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + catppuccin.url = "github:catppuccin/nix"; }; @@ -56,8 +61,25 @@ , flake-utils , nur , catppuccin + , my-nixvim , ... }@inputs: let + nixvimOverlay = (final: prev: { + nixvim = self.packages.${prev.stdenv.system}.nixvim; + }); + overlayModule = { ... }: { + nixpkgs.overlays = [ + nixvimOverlay + (import ./overlays/add-pkgs.nix) + ]; + }; + deploymentModule = { + deployment.targetUser = "xin"; + }; + sharedColmenaModules = [ + self.nixosModules.default + deploymentModule + ]; sharedHmModules = [ inputs.sops-nix.homeManagerModules.sops inputs.nix-index-database.hmModules.nix-index @@ -96,28 +118,17 @@ modules = [ self.nixosModules.default nur.nixosModules.nur - ./overlays ] ++ modules; }; in { nixpkgs = nixpkgs; - nixosModules.default = import ./modules/nixos; + nixosModules.default = { imports = [ ./modules/nixos overlayModule ]; }; homeManagerModules = import ./modules/home-manager; homeConfigurations = builtins.listToAttrs [ (mkHomeConfiguration "xin" "calcite") ]; - colmenaHive = - let - deploymentModule = { - deployment.targetUser = "xin"; - }; - sharedColmenaModules = [ - self.nixosModules.default - deploymentModule - ]; - in - inputs.colmena.lib.makeHive { + colmenaHive = inputs.colmena.lib.makeHive { meta = { nixpkgs = import nixpkgs { system = "x86_64-linux"; @@ -210,6 +221,10 @@ packages = with pkgs; [ nix git colmena sops nix-output-monitor nil nvd ]; }; }; + + packages = { + nixvim = my-nixvim.packages.${system}.default; + }; } ); } diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 23f5c24..14159ce 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -9,4 +9,4 @@ ./vscode.nix ./zellij.nix ]; -} \ No newline at end of file +} diff --git a/modules/home-manager/vim.nix b/modules/home-manager/vim.nix index d818132..f66535f 100644 --- a/modules/home-manager/vim.nix +++ b/modules/home-manager/vim.nix @@ -1,43 +1,22 @@ -{ config, pkgs, lib, ... }: - -with lib; - +{ config, pkgs, lib, ... }: let + inherit (lib) mkIf mkEnableOption getExe; cfg = config.custom-hm.neovim; + tomlFormat = pkgs.formats.toml { }; + neovideConfig = { + neovim-bin = getExe pkgs.nixvim; + fork = true; + }; in { options.custom-hm.neovim = { enable = mkEnableOption "neovim configurations"; }; config = mkIf cfg.enable { - programs.neovim = { - enable = true; - vimAlias = true; - vimdiffAlias = true; - plugins = with pkgs.vimPlugins; [ - catppuccin-nvim - ]; - extraConfig = '' - set nocompatible - - syntax on - set number - set relativenumber - set shortmess+=I - set laststatus=2 - - set ignorecase - set smartcase - set list - set listchars=tab:→· - set tabstop=4 - set shiftwidth=4 - set expandtab - - set mouse+=a - - colorscheme catppuccin-macchiato - ''; + home.packages = with pkgs; [ nixvim neovide ]; + programs.neovim.enable = false; + home.file.".config/neovide/config.toml" = { + source = tomlFormat.generate "neovide-config" neovideConfig; }; }; } diff --git a/overlays/add-pkgs.nix b/overlays/add-pkgs.nix index ce339b0..35b6981 100644 --- a/overlays/add-pkgs.nix +++ b/overlays/add-pkgs.nix @@ -1,10 +1,3 @@ -{ config, pkgs, lib, ... }: - -{ - nixpkgs.overlays = [ - (self: super: { - oidc-agent = pkgs.callPackage ./pkgs/oidc-agent { }; - python3 = super.python312; - }) - ]; -} +(final: prev: { + oidc-agent = prev.callPackage ./pkgs/oidc-agent { }; +}) diff --git a/overlays/default.nix b/overlays/default.nix index de8ee08..a94c09a 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,6 +1 @@ -{ config, pkgs, ... }: -{ - imports = [ - ./add-pkgs.nix - ]; -} +final: prev: (import ./add-pkgs.nix)