Migrate to nix flake

This commit is contained in:
Loic Nageleisen 2024-10-18 20:11:01 +02:00
parent 8617f69d4c
commit c3e9c4e745
Signed by: lloeki
GPG key ID: D05DAEE6889F94C2
5 changed files with 120 additions and 10 deletions

1
.gitignore vendored
View file

@ -4,4 +4,5 @@
/plugged/* /plugged/*
/autoload/plug.vim.old /autoload/plug.vim.old
/.envrc /.envrc
/.direnv
/localvim /localvim

10
default.nix Normal file
View file

@ -0,0 +1,10 @@
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix

76
flake.lock generated Normal file
View file

@ -0,0 +1,76 @@
{
"nodes": {
"flake-compat": {
"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-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1729097500,
"narHash": "sha256-NMxk91m62pA97pbHqYDNhTgzr24MzKf5D+ZCDlmHXmw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "764efd34fe199a705d62d0738452076e8276dd98",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

23
flake.nix Normal file
View file

@ -0,0 +1,23 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};
outputs = { self, nixpkgs, flake-utils, flake-compat }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
vim
neovim
vim-language-server
vim-vint
];
};
}
);
}

View file

@ -1,10 +1,10 @@
{ pkgs ? import(fetchTarball("https://github.com/NixOS/nixpkgs/archive/d51f8579f03a76718d643dd184ae964e6f0dd751.tar.gz")) {} }: (import
(
pkgs.mkShell { let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
nativeBuildInputs = with pkgs; [ fetchTarball {
vim url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
neovim sha256 = lock.nodes.flake-compat.locked.narHash;
vim-language-server
vim-vint
];
} }
)
{ src = ./.; }
).shellNix