nix changes

This commit is contained in:
Nikos Papadakis 2023-09-26 18:12:40 +03:00
parent 1c98aef8a0
commit b7394a55d3
Signed by untrusted user who does not match committer: nikos
GPG key ID: 78871F9905ADFF02
5 changed files with 114 additions and 15 deletions

View file

@ -18,6 +18,24 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1687709756,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -61,7 +79,43 @@
"type": "github"
}
},
"nil": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1695485017,
"narHash": "sha256-aQyRBJnT4tftexM/Y3etfOk8tfMFZzt+vSVtL2J0KLY=",
"owner": "oxalica",
"repo": "nil",
"rev": "510bc6e9b41d39c81b9c815065cb5b7e23a2428c",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "nil",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1690441914,
"narHash": "sha256-Ac+kJQ5z9MDAMyzSc0i0zJDx2i3qi9NjlW5Lz285G/I=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "db8672b8d0a2593c2405aed0c1dfa64b2a2f428f",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1695360818,
"narHash": "sha256-JlkN3R/SSoMTa+CasbxS1gq+GpGxXQlNZRUh9+LIy/0=",
@ -81,7 +135,33 @@
"inputs": {
"home-manager": "home-manager",
"neovim": "neovim",
"nixpkgs": "nixpkgs"
"nil": "nil",
"nixpkgs": "nixpkgs_2"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"nil",
"flake-utils"
],
"nixpkgs": [
"nil",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688783586,
"narHash": "sha256-HHaM2hk2azslv1kH8zmQxXo2e7i5cKgzNIuK4yftzB0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "7a29283cc242c2486fc67f60b431ef708046d176",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {
@ -98,6 +178,21 @@
"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"
}
}
},
"root": "root",

View file

@ -11,12 +11,14 @@
url = "github:neovim/neovim?dir=contrib";
inputs.nixpkgs.follows = "nixpkgs";
};
nil.url = "github:oxalica/nil";
};
outputs = { nixpkgs, home-manager, neovim, ... }:
let
system = "x86_64-linux"; # change your system type here
user = "nikos"; # change your user here
system = "x86_64-linux"; # change your system type here
user = "nikos"; # change your user here
dotfilesHome = "/home/nikos/.dotfiles"; # specify your dotfiles path
pkgs = nixpkgs.legacyPackages.${system};
in
{
@ -36,6 +38,8 @@
];
}
];
extraSpecialArgs = { extra = { inherit user dotfilesHome; }; };
};
};
}

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, extra, ... }:
{
home.username = "nikos";
home.homeDirectory = "/home/nikos";
home.username = "${extra.user}";
home.homeDirectory = "/home/${extra.user}";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
@ -22,7 +22,7 @@
xdg.dataFile = {
"nvim/lazy-lock.json".source =
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.dotfiles/lazy-lock.json";
config.lib.file.mkOutOfStoreSymlink "${extra.dotfilesHome}/lazy-lock.json";
};
# The home.packages option allows you to install Nix packages into your
@ -49,15 +49,14 @@
programs.fish = {
enable = true;
shellInit = builtins.readFile ./fish/config.fish;
functions = lib.attrsets.mapAttrs'
shellInit = lib.strings.concatStringsSep "\n" ([
(builtins.readFile ./fish/config.fish)
] ++ lib.attrsets.mapAttrsToList
(
name: value: {
name = builtins.replaceStrings [ ".fish" ] [ "" ] name;
value = builtins.readFile (./fish/functions + ("/" + name));
}
name: value: builtins.readFile (./fish/functions + ("/" + name))
)
(builtins.readDir ./fish/functions);
(builtins.readDir ./fish/functions)
);
};
# Let Home Manager install and manage itself.

View file

@ -125,7 +125,7 @@ local servers = {
},
},
gopls = {},
rnix = {},
nil_ls = {},
jedi_language_server = {}, -- python lsp
ruff_lsp = {}, -- python linter
rust_analyzer = {

View file

@ -3,5 +3,6 @@ pkgs: with pkgs; [
ripgrep # "rg" cli, alternative to grep, used by nvim
fd # find alternative, used by nvim
lsd # "ls" alternative
nil # Nix LSP
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) # nerdfonts jetbrains mono
]