Add penguin configuration

This commit is contained in:
2025-08-19 00:34:18 +08:00
parent 2835a0a72e
commit c594ff128f
7 changed files with 296 additions and 14 deletions

View File

@@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.my_nix;
inherit (lib) mkEnableOption mkIf mkOption;
types = lib.types;
in
{
options.my_nix = {
enable = mkEnableOption "Custom nix options";
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.cachix ];
nix = {
optimise = {
automatic = true;
};
settings = {
experimental-features = [
"nix-command"
"flakes"
];
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
};
nixpkgs.config = {
allowUnfree = true;
};
};
}

View File

@@ -0,0 +1,40 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.my_users;
inherit (lib) mkEnableOption mkIf mkOption;
types = lib.types;
in
{
options.my_users = {
enable = mkEnableOption "Users";
defaultShell = mkOption {
default = pkgs.zsh;
type = types.package;
};
};
config = mkIf cfg.enable {
security.sudo.wheelNeedsPassword = false;
users.defaultUserShell = cfg.defaultShell;
programs.zsh.enable = true; # I feel like this should be behind a flag but fuckit
nix.settings.trusted-users = [
"root"
"yadunut"
];
users.users = {
yadunut = lib.snowfall.mkUser {
extraGroups = [ "wheel" ];
shell = pkgs.zsh;
hashedPassword = "$y$j9T$9ATrmrhedhb.mAZ4//PiN/$OStCOaJHt3kPA63imTG3zLMWCSLoWCUph5O6jl5mcZ.";
};
root = lib.snowfall.mkUser {
hashedPassword = "$6$xa/mFg4OxIbb8XiQ$S2RVyCKcLaKHymFs48u8vj1dv.mQdxt.BQoucJsr8wfcHayXwKfD0C2NIOYY5AEPR9zgnMvFp8d8STKe6wMGR/";
};
};
};
}