1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 19:47:47 +00:00

Configure CLI tools for all users, including root

This commit is contained in:
RGBCube 2023-11-13 19:02:55 +03:00
parent 2aacc688f2
commit 9e6687400b
No known key found for this signature in database
8 changed files with 19 additions and 16 deletions

View file

@ -19,21 +19,22 @@
}; };
inputs = { inputs = {
fenix = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
}; };
outputs = { fenix, home-manager, nixpkgs, ... } @ inputs: let outputs = { nixpkgs, home-manager, fenix, ... } @ inputs: let
machines = [ machines = [
./machines/enka ./machines/enka
]; ];
@ -74,7 +75,9 @@
# HOME # HOME
homeConfiguration = userName: attributes: systemConfiguration { homeConfiguration = userName: attributes: systemConfiguration {
home-manager.users.${userName} = attributes; home-manager.users = builtins.foldl' lib.recursiveUpdate {} (builtins.map (userName: {
${userName} = attributes;
}) (if builtins.isList userName then userName else [ userName ]));
}; };
homePackages = userName: packages: homeConfiguration userName { homePackages = userName: packages: homeConfiguration userName {

View file

@ -4,7 +4,7 @@
bat bat
]) ])
(homeConfiguration "nixos" { (homeConfiguration [ "nixos" "root" ] {
programs.nushell.environmentVariables = { programs.nushell.environmentVariables = {
MANPAGER = ''"bat --plain --language man"''; MANPAGER = ''"bat --plain --language man"'';
PAGER = ''"bat --plain"''; PAGER = ''"bat --plain"'';

View file

@ -10,7 +10,7 @@
system.stateVersion = "23.05"; system.stateVersion = "23.05";
}) })
(homeConfiguration "nixos" { (homeConfiguration [ "nixos" "root" ] {
home.stateVersion = "23.05"; home.stateVersion = "23.05";
}) })

View file

@ -1,6 +1,6 @@
{ homeConfiguration, enabled, ... }: { homeConfiguration, enabled, ... }:
homeConfiguration "nixos" { homeConfiguration [ "nixos" "root" ] {
programs.nushell.shellAliases = { programs.nushell.shellAliases = {
g = "git"; g = "git";
ga = "git add"; ga = "git add";

View file

@ -1,6 +1,6 @@
{ lib, pkgs, homeConfiguration, homePackages, enabled, ... }: lib.recursiveUpdate { lib, pkgs, homeConfiguration, homePackages, enabled, ... }: lib.recursiveUpdate
(homeConfiguration "nixos" { (homeConfiguration [ "nixos" "root" ] {
programs.nushell.environmentVariables.EDITOR = "hx"; programs.nushell.environmentVariables.EDITOR = "hx";
programs.helix = enabled { programs.helix = enabled {
@ -38,7 +38,7 @@
settings.keys = lib.recursiveUpdate settings.keys = lib.recursiveUpdate
(builtins.foldl' (x: y: lib.recursiveUpdate x y) {} (builtins.map (mode: { ${mode} = { (builtins.foldl' lib.recursiveUpdate {} (builtins.map (mode: { ${mode} = {
C-h = "move_prev_word_start"; C-h = "move_prev_word_start";
C-l = "move_next_word_end"; C-l = "move_next_word_end";
C-k = "move_visual_line_up"; C-k = "move_visual_line_up";
@ -50,7 +50,7 @@
C-down = "move_visual_line_down"; C-down = "move_visual_line_down";
}; }) [ "insert" "normal" "select" ])) }; }) [ "insert" "normal" "select" ]))
(builtins.foldl' (x: y: lib.recursiveUpdate x y) {} (builtins.map (mode: { (builtins.foldl' lib.recursiveUpdate {} (builtins.map (mode: {
${mode}.D = "extend_to_line_end"; ${mode}.D = "extend_to_line_end";
}) [ "normal" "select" ])); }) [ "normal" "select" ]));
}; };

View file

@ -4,7 +4,7 @@
users.users.nixos.shell = pkgs.nushell; users.users.nixos.shell = pkgs.nushell;
}) })
(homeConfiguration "nixos" { (homeConfiguration [ "nixos" "root" ] {
programs.starship = enabled {}; programs.starship = enabled {};
programs.nushell = enabled { programs.nushell = enabled {

View file

@ -9,7 +9,7 @@
poetry poetry
]) ])
(homeConfiguration "nixos" { (homeConfiguration [ "nixos" "root" ] {
programs.nushell.shellAliases = { programs.nushell.shellAliases = {
venv = "virtualenv venv"; venv = "virtualenv venv";
}; };

View file

@ -4,6 +4,6 @@
steck steck
]) ])
(homeConfiguration "nixos" { (homeConfiguration [ "nixos" "root" ] {
programs.nushell.shellAliases.share = "steck paste"; programs.nushell.shellAliases.share = "steck paste";
}) })