mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 03:27:45 +00:00
Don't hardcode users and rename nixos@cube to rgb@cube
This commit is contained in:
parent
9cb7a69c46
commit
d919eb6f19
8 changed files with 73 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -32,6 +32,7 @@
|
||||||
!modules/nushell/
|
!modules/nushell/
|
||||||
!modules/openssh/
|
!modules/openssh/
|
||||||
!modules/openttd/
|
!modules/openttd/
|
||||||
|
!modules/packages/
|
||||||
!modules/pipewire/
|
!modules/pipewire/
|
||||||
!modules/pueue/
|
!modules/pueue/
|
||||||
!modules/python/
|
!modules/python/
|
||||||
|
|
22
flake.nix
22
flake.nix
|
@ -91,9 +91,13 @@
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
|
||||||
ulib = import ./lib lib;
|
configuration = host: {
|
||||||
|
system,
|
||||||
|
normalUsers,
|
||||||
|
graphicalUsers ? [],
|
||||||
|
}: let
|
||||||
|
ulib = import ./lib lib normalUsers graphicalUsers;
|
||||||
|
|
||||||
configuration = host: system: let
|
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
|
||||||
upkgs = {
|
upkgs = {
|
||||||
|
@ -148,8 +152,18 @@
|
||||||
configurations = builtins.mapAttrs configuration;
|
configurations = builtins.mapAttrs configuration;
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = configurations {
|
nixosConfigurations = configurations {
|
||||||
enka = "x86_64-linux";
|
enka = {
|
||||||
cube = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
normalUsers = [ "nixos" "root" ];
|
||||||
|
graphicalUsers = [ "nixos" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
cube = {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
normalUsers = [ "nixos" "root" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
time.timeZone = "Europe/Amsterdam";
|
time.timeZone = "Europe/Amsterdam";
|
||||||
|
|
||||||
users.users.nixos = normalUser {
|
users.users.rgb = normalUser {
|
||||||
description = "NixOS";
|
description = "NixOS";
|
||||||
extraGroups = [ "wheel" ];
|
extraGroups = [ "wheel" ];
|
||||||
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRSLWxpIMOZIQv9ggDnAwSxmux/TZvuEPgq2HFiH+oI2OE07xYQAiroBVI5HH+aIg1nwpYtArANoD8V9Hrx2XCo2py/fMi9LhJWNMlFVcRLqYrCmrZYhBqZhxXIdY+wXqkSE7kvTKsz84BrhwilfA/bqTgVw2Ro6w0RnTzUhlYx4w10DT3isN09cQJMgvuyWNRlpGpkEGhPwyXythKM2ERoHTfq/XtpiGZQeLr6yoTTd9q4rbvnGGka5IUEz3RrmeXEs13l02IY6dCUFJkRRsK8dvB9zFjQyM08IqdaoHeudZoCOsnl/AiegZ7C5FoYEKIXY86RqxS3TH3nwuxe2fXTNr9gwf2PumM1Yh2WxV4+pHQOksxW8rWgv1nXMT5AG0RrJxr+S0Nn7NBbzCImrprX3mg4vJqT24xcUjUSDYllEMa2ioXGCeff8cwVKK/Ly5fwj0AX1scjiw+b7jD6VvDLA5z+ALwCblxiRMCN0SOMk9/V2Xsg9YIRMHyQwpqu8k= u0_a216@localhost" ];
|
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRSLWxpIMOZIQv9ggDnAwSxmux/TZvuEPgq2HFiH+oI2OE07xYQAiroBVI5HH+aIg1nwpYtArANoD8V9Hrx2XCo2py/fMi9LhJWNMlFVcRLqYrCmrZYhBqZhxXIdY+wXqkSE7kvTKsz84BrhwilfA/bqTgVw2Ro6w0RnTzUhlYx4w10DT3isN09cQJMgvuyWNRlpGpkEGhPwyXythKM2ERoHTfq/XtpiGZQeLr6yoTTd9q4rbvnGGka5IUEz3RrmeXEs13l02IY6dCUFJkRRsK8dvB9zFjQyM08IqdaoHeudZoCOsnl/AiegZ7C5FoYEKIXY86RqxS3TH3nwuxe2fXTNr9gwf2PumM1Yh2WxV4+pHQOksxW8rWgv1nXMT5AG0RrJxr+S0Nn7NBbzCImrprX3mg4vJqT24xcUjUSDYllEMa2ioXGCeff8cwVKK/Ly5fwj0AX1scjiw+b7jD6VvDLA5z+ALwCblxiRMCN0SOMk9/V2Xsg9YIRMHyQwpqu8k= u0_a216@localhost" ];
|
||||||
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
(importModules [
|
(importModules [
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./packages.nix
|
|
||||||
|
|
||||||
"bat"
|
"bat"
|
||||||
"btop"
|
"btop"
|
||||||
|
@ -34,6 +33,7 @@
|
||||||
"nushell"
|
"nushell"
|
||||||
"openssh"
|
"openssh"
|
||||||
"pueue"
|
"pueue"
|
||||||
|
"packages"
|
||||||
"python"
|
"python"
|
||||||
"ripgrep"
|
"ripgrep"
|
||||||
"rust"
|
"rust"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
time.timeZone = "Europe/Istanbul";
|
time.timeZone = "Europe/Istanbul";
|
||||||
|
|
||||||
users.users.nixos = graphicalUser {
|
users.users.nixos = normalUser {
|
||||||
description = "NixOS";
|
description = "NixOS";
|
||||||
extraGroups = [ "wheel" ];
|
extraGroups = [ "wheel" ];
|
||||||
};
|
};
|
||||||
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
(importModules [
|
(importModules [
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./packages.nix
|
|
||||||
|
|
||||||
"autofreq"
|
"autofreq"
|
||||||
"bat"
|
"bat"
|
||||||
|
@ -46,6 +45,7 @@
|
||||||
"nix"
|
"nix"
|
||||||
"nushell"
|
"nushell"
|
||||||
"openttd"
|
"openttd"
|
||||||
|
"packages"
|
||||||
"pipewire"
|
"pipewire"
|
||||||
"pueue"
|
"pueue"
|
||||||
"python"
|
"python"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
normalUsers: graphicalUsers:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
systemConfiguration = configuration: configuration;
|
systemConfiguration = configuration: configuration;
|
||||||
|
|
||||||
|
@ -15,14 +17,12 @@ rec {
|
||||||
}) {} (if builtins.isList users then users else [ users ]);
|
}) {} (if builtins.isList users then users else [ users ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
# FIXME: Don't hardcode these.
|
graphicalConfiguration = userHomeConfiguration graphicalUsers;
|
||||||
graphicalConfiguration = userHomeConfiguration "nixos";
|
|
||||||
graphicalPackages = packages: graphicalConfiguration {
|
graphicalPackages = packages: graphicalConfiguration {
|
||||||
home.packages = packages;
|
home.packages = packages;
|
||||||
};
|
};
|
||||||
|
|
||||||
# FIXME: Don't hardcode these.
|
homeConfiguration = userHomeConfiguration normalUsers;
|
||||||
homeConfiguration = userHomeConfiguration [ "nixos" "root" ];
|
|
||||||
homePackages = packages: homeConfiguration {
|
homePackages = packages: homeConfiguration {
|
||||||
home.packages = packages;
|
home.packages = packages;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
lib:
|
lib: normalUsers: graphicalUsers:
|
||||||
|
|
||||||
(import ./configuration.nix)
|
(import ./configuration.nix normalUsers graphicalUsers)
|
||||||
//
|
//
|
||||||
(import ./merge.nix lib)
|
(import ./merge.nix lib)
|
||||||
//
|
//
|
||||||
|
|
|
@ -6,9 +6,4 @@
|
||||||
normalUser = attributes: attributes // {
|
normalUser = attributes: attributes // {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
graphicalUser = attributes: attributes // {
|
|
||||||
extraGroups = [ "graphical" ] ++ (attributes.extraGroups or []);
|
|
||||||
isNormalUser = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
44
modules/packages/default.nix
Normal file
44
modules/packages/default.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{ ulib, pkgs, upkgs, ... }: with ulib; merge
|
||||||
|
|
||||||
|
(systemPackages (with pkgs; [
|
||||||
|
asciinema
|
||||||
|
fastfetch
|
||||||
|
fd
|
||||||
|
hyperfine
|
||||||
|
moreutils
|
||||||
|
nix-index
|
||||||
|
nix-output-monitor
|
||||||
|
p7zip
|
||||||
|
pstree
|
||||||
|
strace
|
||||||
|
timg
|
||||||
|
tree
|
||||||
|
usbutils
|
||||||
|
yt-dlp
|
||||||
|
|
||||||
|
wine
|
||||||
|
|
||||||
|
clang_16
|
||||||
|
clang-tools_16
|
||||||
|
gh
|
||||||
|
go
|
||||||
|
jdk
|
||||||
|
lld
|
||||||
|
maven
|
||||||
|
upkgs.zig
|
||||||
|
vlang
|
||||||
|
]))
|
||||||
|
|
||||||
|
(graphicalPackages (with pkgs; [
|
||||||
|
qbittorrent
|
||||||
|
thunderbird
|
||||||
|
whatsapp-for-linux
|
||||||
|
xfce.thunar
|
||||||
|
|
||||||
|
krita
|
||||||
|
obs-studio
|
||||||
|
|
||||||
|
libreoffice
|
||||||
|
hunspellDicts.en_US
|
||||||
|
hunspellDicts.en_GB-ize
|
||||||
|
]))
|
Loading…
Add table
Add a link
Reference in a new issue