modularize config
This commit is contained in:
parent
48f0c3b3ec
commit
65ff3fcd11
25 changed files with 88 additions and 14 deletions
31
modules/desktop/boot.nix
Normal file
31
modules/desktop/boot.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ ... }:
|
||||
{
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
initrd.systemd.enable = true;
|
||||
plymouth = {
|
||||
enable = true;
|
||||
# theme = "bgrt";
|
||||
# logo = "${pkgs.nixos-icons}/share/icons/hicolor/48x48/apps/nix-snowflake-white.png";
|
||||
# font = "${pkgs.dejavu_fonts.minimal}/share/fonts/truetype/DejaVuSans.ttf";
|
||||
};
|
||||
|
||||
consoleLogLevel = 0;
|
||||
initrd.verbose = false;
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"loglevel=3"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
# Hide the OS choice for bootloaders.
|
||||
# It's still possible to open the bootloader list by pressing any key
|
||||
# It will just not appear on screen unless a key is pressed
|
||||
loader.timeout = 0;
|
||||
|
||||
};
|
||||
}
|
16
modules/desktop/default.nix
Normal file
16
modules/desktop/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ hostname, ... }:
|
||||
{
|
||||
networking.hostName = hostname;
|
||||
imports = [
|
||||
./boot.nix
|
||||
./nfs-client.nix
|
||||
./nix-ld.nix
|
||||
./printers.nix
|
||||
./remoteBuilder.nix
|
||||
./ssh-server.nix
|
||||
];
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
services.hardware.bolt.enable = true;
|
||||
|
||||
}
|
18
modules/desktop/nfs-client.nix
Normal file
18
modules/desktop/nfs-client.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nfs-utils
|
||||
];
|
||||
services.autofs = {
|
||||
enable = true;
|
||||
autoMaster = let
|
||||
mapConf = pkgs.writeText "auto.nfs" ''
|
||||
roms -fstype=nfs4 192.168.178.19:/roms
|
||||
'';
|
||||
in ''
|
||||
/mnt/nfs ${mapConf}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
7
modules/desktop/nix-ld.nix
Normal file
7
modules/desktop/nix-ld.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
programs.nix-ld.libraries = with pkgs; [
|
||||
];
|
||||
}
|
13
modules/desktop/printers.nix
Normal file
13
modules/desktop/printers.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = [ pkgs.gutenprint pkgs.gutenprintBin ];
|
||||
};
|
||||
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
22
modules/desktop/remoteBuilder.nix
Normal file
22
modules/desktop/remoteBuilder.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
nix.buildMachines = [ {
|
||||
hostName = "Anton";
|
||||
sshUser = "builder";
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
protocol = "ssh";
|
||||
# if the builder supports building for multiple architectures,
|
||||
# replace the previous line by, e.g.
|
||||
# systems = ["x86_64-linux" "aarch64-linux"];
|
||||
maxJobs = 1;
|
||||
speedFactor = 2;
|
||||
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||
mandatoryFeatures = [ ];
|
||||
}];
|
||||
nix.distributedBuilds = true;
|
||||
# optional, useful when the builder has a faster internet connection than yours
|
||||
nix.extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
'';
|
||||
}
|
22
modules/desktop/ssh-server.nix
Normal file
22
modules/desktop/ssh-server.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ ... }:
|
||||
{
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = null; # Allows all users by default. Can be [ "user1" "user2" ]
|
||||
UseDns = true;
|
||||
X11Forwarding = false;
|
||||
PermitRootLogin = "prohibit-password"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no"
|
||||
};
|
||||
};
|
||||
|
||||
users.users.willifan.openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDMRriQfw3pusl04fGhCNVoRRpye71ZwkDXAtKB/FP1DLXA4cYrwjLzv/fG1hXi7lAMp2vLiABAg/UaTE8roGzlt62XsFNwc1TI5M8m67J0kLkCtz3MkIixe/3GOFXr03g80DPncLyoIYPvvNd/TftTBK4yrrZPvMJaRrZhW/QdLPQpdHalcNRZ4bnBOCtCoqQ6RGrRi2EeKaJDYIFNl13b9FxrXEJcXnbSDdr1KI3q7a+vkefI2knUf2Uk7ufOWTQ1aqc0heGtCNlHzwZUzW/dfrpPmoVPq3Fqxqd9uXqxMk1Z3VnOwWcK3VXfzzBXKTsX0MaUgF1EqxibkYs9bDZqLEXoRucBqk3wwMPy8RJXqQOupoqa2xEOoduBf1qDHEEm69coHCpPm2mQVUrwsPrmTHmOjh9ir0mkVBDRgHvhq/ctQTVO5/SE2NCgPdlvUV5s44LLsUyxBp5JWwXZWlVys+7Dhil6mtRDcH4CXceJn0VZ61Zv2jrCTxQjKsroitSkNbpAkKajQ9moLMAblsSwJzl3uvJJ3ydlxjZefwTO/GjyuJMY2sIU2Tu0YbIVgMyq5L782LduVlyWj+RLWoEu19OfMqQvTWhJnQPAbR82qGzlfTGRLUxoY+G5MYipJwgrBQ2TnpWvfpTrZxFrglSfekz0v54lWzNZpW+irImh4w== willifan@proton.me"
|
||||
];
|
||||
|
||||
nix.settings.trusted-users = [ "willifan" ];
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue