diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | flake.lock | 228 | ||||
-rw-r--r-- | flake.nix | 88 |
3 files changed, 317 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..bb859f5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,228 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704152458, + "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704498488, + "narHash": "sha256-yINKdShHrtjdiJhov+q0s3Y3B830ujRoSbHduUNyKag=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "51e44a13acea71b36245e8bd8c7db53e0a3e61ee", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704277720, + "narHash": "sha256-meAKNgmh3goankLGWqqpw73pm9IvXjEENJloF0coskE=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "0dd382b70c351f528561f71a0a7df82c9d2be9a4", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704722960, + "narHash": "sha256-mKGJ3sPsT6//s+Knglai5YflJUF2DGj7Ai6Ynopz0kI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "317484b1ead87b9c1b8ac5261a8d2dd748a0492d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1704538339, + "narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts", + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1704958333, + "narHash": "sha256-yYgtaJnaDtUzd2X5jL+Zy38rtKPEu328oy5x7cOaH+I=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "0379ab34cc7bc1b846bfdbb3d6707f5c8b03ce2c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704668415, + "narHash": "sha256-BMzNHFod53iiU4lkR5WHwqQCFmaCLq85sUCskXneXlA=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "44493e2b3c3ebcd39a9947e9ed9f2c2af164ec4c", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixvim": "nixvim" + } + }, + "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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5e0345e --- /dev/null +++ b/flake.nix @@ -0,0 +1,88 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixvim.url = "github:nix-community/nixvim"; + }; + + outputs = { + self, + nixpkgs, + nixvim, + }: let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + npkgs = nixvim.legacyPackages.x86_64-linux; + in { + packages.x86_64-linux.default = npkgs.makeNixvimWithModule { + module = { + config = { + extraPackages = [ + pkgs.black + pkgs.alejandra + pkgs.shfmt + pkgs.cargo + pkgs.rustfmt + pkgs.go + ]; + options = {mouse = "";}; + colorschemes.kanagawa = { + enable = true; + transparent = true; + }; + plugins = { + lsp = { + enable = true; + servers = { + bashls.enable = true; + nixd.enable = true; + ruff-lsp.enable = true; + gopls.enable = true; + }; + }; + rust-tools.enable = true; + conform-nvim = { + enable = true; + formatAfterSave.lspFallback = false; + formattersByFt = { + python = ["black"]; + nix = ["alejandra"]; + rust = ["rustfmt"]; + go = ["gofmt"]; + _ = ["shfmt"]; + }; + formatters.shfmt = { + prepend_args = ["-i" "2"]; + }; + }; + luasnip.enable = true; + nvim-cmp = { + enable = true; + snippet.expand = "luasnip"; + autoEnableSources = true; + sources = [ + {name = "nvim_lsp";} + {name = "path";} + {name = "buffer";} + ]; + mapping = { + "<CR>" = "cmp.mapping.confirm({ select = true })"; + "<Tab>" = { + action = '' + cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item({ + behavior = cmp.SelectBehavior.Select + }) + else + fallback() + end + end, {"i","s","c",}) + ''; + }; + }; + }; + }; + }; + }; + }; + }; +} |