1
0
Fork 0
forked from emily/nixfiles
nixfiles-emily/config/common/default.nix

105 lines
2.4 KiB
Nix
Raw Normal View History

2024-04-29 12:22:22 +02:00
{ config, lib, pkgs, ... }:
2024-01-09 15:46:18 +01:00
2024-01-09 15:55:29 +01:00
with lib; {
2024-01-09 15:46:18 +01:00
imports = [
2024-01-18 16:03:31 +01:00
./kernel.nix
2024-01-09 15:46:18 +01:00
./networking.nix
./openssh.nix
2024-01-18 16:03:31 +01:00
./users
../../modules
2024-01-09 15:46:18 +01:00
];
environment.systemPackages = with pkgs; [
kitty.terminfo
bat
2024-02-22 20:20:07 +01:00
dig
2024-01-09 15:46:18 +01:00
ripgrep
2024-01-09 16:23:24 +01:00
uutils-coreutils
2024-01-09 15:46:18 +01:00
git
bmon
bottom
man-pages
man-pages-posix
unzip
zip
2024-01-16 20:03:30 +01:00
figlet
2024-01-09 15:46:18 +01:00
];
2024-02-05 22:22:40 +01:00
programs = {
mtr.enable = true;
fish.enable = true;
};
2024-01-16 20:03:30 +01:00
kyouma.deployment.tags = [ "all" ];
2024-03-28 10:15:54 +01:00
2024-01-16 20:03:30 +01:00
security.dhparams.defaultBitSize = 4096;
system.activationScripts.motd.text = let
cfg = config.system.nixos;
in ''
2024-02-22 20:20:07 +01:00
root=/var/lib/deployment
2024-01-16 20:03:30 +01:00
mkdir -p $root
date "+%s" > $root/date
cat << EOF > $root/motd
Welcome to ${cfg.distroName} ${cfg.release} ("${cfg.codeName}") on
2024-02-22 20:20:07 +01:00
$(${pkgs.figlet}/bin/figlet -lt -f slant ${config.networking.hostName} | ${pkgs.gnused}/bin/sed -e 's/[[:space:]]*$//').${config.networking.domain}
Last deployed on $(date "+%F %T %Z" -d @$(cat "$root/date"))
2024-01-16 20:03:30 +01:00
EOF
'';
2024-02-22 20:20:07 +01:00
users.motdFile = "/var/lib/deployment/motd";
2024-01-16 20:03:30 +01:00
nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 7d";
2024-01-17 14:34:33 +01:00
nix.optimise.automatic = true;
2024-04-03 10:38:55 +02:00
nix.registry.nixpkgs.to = {
type = "path";
path = pkgs.path;
};
2024-05-11 16:02:39 +02:00
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ "root" "@wheel" ];
substituters = [ "https://cache.kyouma.net" ];
trusted-public-keys = [ "cache.kyouma.net:Frjwu4q1rnwE/MnSTmX9yx86GNA/z3p/oElGvucLiZg=" ];
};
2024-04-03 10:38:55 +02:00
nix.extraOptions = ''
builders-use-substitutes = true
'';
2024-02-05 22:22:40 +01:00
2024-02-22 20:20:07 +01:00
nixpkgs.config.allowUnfree = true;
2024-01-16 20:03:30 +01:00
2024-02-14 21:40:07 +01:00
boot.tmp.cleanOnBoot = mkDefault true;
2024-02-05 22:22:40 +01:00
services.journald.extraConfig = "SystemMaxUse=256M";
2024-04-16 22:17:16 +02:00
security.sudo = {
2024-02-05 22:22:40 +01:00
enable = true;
execWheelOnly = true;
2024-02-22 20:20:07 +01:00
wheelNeedsPassword = false;
2024-02-05 22:22:40 +01:00
};
2024-04-16 22:17:16 +02:00
security.sudo-rs = {
enable = false;
execWheelOnly = true;
wheelNeedsPassword = false;
};
2024-02-22 20:20:07 +01:00
users.mutableUsers = mkDefault false;
i18n.defaultLocale = mkDefault "en_EU.UTF-8";
i18n.glibcLocales = (pkgs.glibcLocales.overrideAttrs (orig: {
postPatch = orig.postPatch + ''
cp "${../files/en_EU}" localedata/locales/en_EU
echo 'en_EU.UTF-8/UTF-8 \' >>localedata/SUPPORTED
'';
}));
2024-02-27 19:07:12 +01:00
services.xserver.xkb = {
2024-02-22 20:20:07 +01:00
layout = "de";
2024-02-27 19:07:12 +01:00
variant = "neo_qwerty";
2024-02-22 20:20:07 +01:00
};
console.useXkbConfig = true;
console.earlySetup = true;
2024-02-05 22:22:40 +01:00
services.fprintd.enable = config.kyouma.machine-type.graphical;
2024-01-09 15:46:18 +01:00
system.stateVersion = "23.11";
time.timeZone = mkDefault "CET";
}