mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 11:07:44 +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/openssh/
|
||||
!modules/openttd/
|
||||
!modules/packages/
|
||||
!modules/pipewire/
|
||||
!modules/pueue/
|
||||
!modules/python/
|
||||
|
|
22
flake.nix
22
flake.nix
|
@ -91,9 +91,13 @@
|
|||
} @ inputs: let
|
||||
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; };
|
||||
|
||||
upkgs = {
|
||||
|
@ -148,8 +152,18 @@
|
|||
configurations = builtins.mapAttrs configuration;
|
||||
in {
|
||||
nixosConfigurations = configurations {
|
||||
enka = "x86_64-linux";
|
||||
cube = "x86_64-linux";
|
||||
enka = {
|
||||
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";
|
||||
|
||||
users.users.nixos = normalUser {
|
||||
users.users.rgb = normalUser {
|
||||
description = "NixOS";
|
||||
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" ];
|
||||
|
@ -20,7 +20,6 @@
|
|||
|
||||
(importModules [
|
||||
./hardware.nix
|
||||
./packages.nix
|
||||
|
||||
"bat"
|
||||
"btop"
|
||||
|
@ -34,6 +33,7 @@
|
|||
"nushell"
|
||||
"openssh"
|
||||
"pueue"
|
||||
"packages"
|
||||
"python"
|
||||
"ripgrep"
|
||||
"rust"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
time.timeZone = "Europe/Istanbul";
|
||||
|
||||
users.users.nixos = graphicalUser {
|
||||
users.users.nixos = normalUser {
|
||||
description = "NixOS";
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
|
@ -21,7 +21,6 @@
|
|||
|
||||
(importModules [
|
||||
./hardware.nix
|
||||
./packages.nix
|
||||
|
||||
"autofreq"
|
||||
"bat"
|
||||
|
@ -46,6 +45,7 @@
|
|||
"nix"
|
||||
"nushell"
|
||||
"openttd"
|
||||
"packages"
|
||||
"pipewire"
|
||||
"pueue"
|
||||
"python"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
normalUsers: graphicalUsers:
|
||||
|
||||
rec {
|
||||
systemConfiguration = configuration: configuration;
|
||||
|
||||
|
@ -15,14 +17,12 @@ rec {
|
|||
}) {} (if builtins.isList users then users else [ users ]);
|
||||
};
|
||||
|
||||
# FIXME: Don't hardcode these.
|
||||
graphicalConfiguration = userHomeConfiguration "nixos";
|
||||
graphicalConfiguration = userHomeConfiguration graphicalUsers;
|
||||
graphicalPackages = packages: graphicalConfiguration {
|
||||
home.packages = packages;
|
||||
};
|
||||
|
||||
# FIXME: Don't hardcode these.
|
||||
homeConfiguration = userHomeConfiguration [ "nixos" "root" ];
|
||||
homeConfiguration = userHomeConfiguration normalUsers;
|
||||
homePackages = packages: homeConfiguration {
|
||||
home.packages = packages;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
lib:
|
||||
lib: normalUsers: graphicalUsers:
|
||||
|
||||
(import ./configuration.nix)
|
||||
(import ./configuration.nix normalUsers graphicalUsers)
|
||||
//
|
||||
(import ./merge.nix lib)
|
||||
//
|
||||
|
|
|
@ -6,9 +6,4 @@
|
|||
normalUser = attributes: attributes // {
|
||||
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