feat: enable nixd

This commit is contained in:
Lucy Hochkamp 2023-10-12 15:10:43 +02:00
parent af77a7b187
commit 8b4d9841ab
No known key found for this signature in database
4 changed files with 92 additions and 64 deletions

8
.nixd.json Normal file
View file

@ -0,0 +1,8 @@
{
"options": {
"enable": true,
"target": {
"installable": ".#nixosConfigurations.picard.options"
}
}
}

119
flake.lock generated
View file

@ -195,6 +195,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_4": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1685662779,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -401,27 +419,6 @@
"type": "github" "type": "github"
} }
}, },
"naersk": {
"inputs": {
"nixpkgs": [
"rnix-lsp",
"nixpkgs"
]
},
"locked": {
"lastModified": 1655042882,
"narHash": "sha256-9BX8Fuez5YJlN7cdPO63InoyBy7dm3VlJkkmTt6fS1A=",
"owner": "nix-community",
"repo": "naersk",
"rev": "cddffb5aa211f50c4b8750adbec0bbbdfb26bb9f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"neovim-flake": { "neovim-flake": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
@ -487,6 +484,27 @@
"type": "github" "type": "github"
} }
}, },
"nixd": {
"inputs": {
"flake-parts": "flake-parts_4",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1697038389,
"narHash": "sha256-hbzFPXyQQxJObRdb+CsylUXii29UfFV7866WWgWYs6Y=",
"owner": "nix-community",
"repo": "nixd",
"rev": "29904e121cc775e7caaf4fffa6bc7da09376a43b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixd",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1696161939, "lastModified": 1696161939,
@ -553,6 +571,24 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib_2": {
"locked": {
"dir": "lib",
"lastModified": 1685564631,
"narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1696419054, "lastModified": 1696419054,
@ -735,28 +771,6 @@
"type": "github" "type": "github"
} }
}, },
"rnix-lsp": {
"inputs": {
"naersk": "naersk",
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1669555118,
"narHash": "sha256-F0s0m62S5bHNVWNHLZD6SeHiLrsDx98VQbRjDyIu+qQ=",
"owner": "nix-community",
"repo": "rnix-lsp",
"rev": "95d40673fe43642e2e1144341e86d0036abd95d9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "rnix-lsp",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
@ -769,6 +783,7 @@
"miro": "miro", "miro": "miro",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nix-vscode-extensions": "nix-vscode-extensions", "nix-vscode-extensions": "nix-vscode-extensions",
"nixd": "nixd",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-darwin": "nixpkgs-darwin",
@ -779,9 +794,8 @@
"octoprint-spoolmanager": "octoprint-spoolmanager", "octoprint-spoolmanager": "octoprint-spoolmanager",
"octoprint-telegram": "octoprint-telegram", "octoprint-telegram": "octoprint-telegram",
"pandoc-latex-template": "pandoc-latex-template", "pandoc-latex-template": "pandoc-latex-template",
"rnix-lsp": "rnix-lsp",
"spoons": "spoons", "spoons": "spoons",
"utils": "utils_2", "utils": "utils",
"x": "x", "x": "x",
"xynoblog": "xynoblog", "xynoblog": "xynoblog",
"zsh-completions": "zsh-completions", "zsh-completions": "zsh-completions",
@ -866,21 +880,6 @@
} }
}, },
"utils": { "utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"inputs": { "inputs": {
"systems": "systems_4" "systems": "systems_4"
}, },

View file

@ -33,8 +33,9 @@
x.inputs.nixpkgs.follows = "nixpkgs"; x.inputs.nixpkgs.follows = "nixpkgs";
## editor stuff ## editor stuff
rnix-lsp.url = "github:nix-community/rnix-lsp"; nixd.url = "github:nix-community/nixd";
rnix-lsp.inputs.nixpkgs.follows = "nixpkgs"; nixd.inputs.nixpkgs.follows = "nixpkgs";
## vim ## vim
nnn-nvim.url = "github:luukvbaal/nnn.nvim"; nnn-nvim.url = "github:luukvbaal/nnn.nvim";
@ -90,6 +91,7 @@
, utils , utils
, xynoblog , xynoblog
, lolpizza , lolpizza
, nixd
, x , x
, ... , ...
}: }:
@ -106,6 +108,7 @@
overlays = [ overlays = [
self.overlays.default self.overlays.default
neovim-nightly-overlay.overlay neovim-nightly-overlay.overlay
nixd.overlays.default
]; ];
genPkgsWithOverlays = system: import nixpkgs { genPkgsWithOverlays = system: import nixpkgs {
inherit system overlays; inherit system overlays;

View file

@ -8,7 +8,7 @@ in
options.ragon.vscode.enable = lib.mkOption { default = false; }; options.ragon.vscode.enable = lib.mkOption { default = false; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
nil nixd
nixpkgs-fmt nixpkgs-fmt
]; ];
programs.vscode = { programs.vscode = {
@ -17,6 +17,7 @@ in
vscodevim.vim # vim mode (hopefully good) vscodevim.vim # vim mode (hopefully good)
jdinhlife.gruvbox # theme jdinhlife.gruvbox # theme
mkhl.direnv # direnv mkhl.direnv # direnv
# tomoki1207.pdf # reenable when latex workshop goes # tomoki1207.pdf # reenable when latex workshop goes
@ -121,8 +122,25 @@ in
} }
]; ];
## Nix ## Nix
"nix.serverPath" = "nil"; "nix.serverPath" = "nixd";
"nix.enableLanguageServer" = true; "nix.enableLanguageServer" = true;
"nix.serverSettings" = {
"nixd" = {
"formatting" = {
"command" = "nixpkgs-fmt";
};
};
};
## dart/flutter
"[dart]" = {
"editor.formatOnSave" = true;
"editor.formatOnType" = true;
"editor.rulers" = [ 80 ];
"editor.selectionHighlight" = false;
"editor.suggestSelection" = "first";
"editor.tabCompletion" = "onlySnippets";
"editor.wordBasedSuggestions" = false;
};
}; };
}; };
}; };