basic configuration for home-server
This commit is contained in:
parent
aaad288f63
commit
b914dc5b2b
2 changed files with 81 additions and 3 deletions
68
modules/server/default.nix
Normal file
68
modules/server/default.nix
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
# Allow ssh access
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PasswordAuthentication = true;
|
||||||
|
KbdInteractiveAuthentication = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Allow packages from nixpkgs
|
||||||
|
nixpkgs.config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
#Optimise nix store
|
||||||
|
nix = {
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than 30d";
|
||||||
|
};
|
||||||
|
settings.auto-optimise-store = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable nix flakes
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
|
# Disable documentation
|
||||||
|
documentation.nixos.enable = false;
|
||||||
|
|
||||||
|
# Enable networking
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Amsterdam";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
|
||||||
|
extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "en_US.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||||
|
LC_MEASUREMENT = "en_US.UTF-8";
|
||||||
|
LC_MONETARY = "en_US.UTF-8";
|
||||||
|
LC_NAME = "en_US.UTF-8";
|
||||||
|
LC_NUMERIC = "en_US.UTF-8";
|
||||||
|
LC_PAPER = "en_US.UTF-8";
|
||||||
|
LC_TELEPHONE = "en_US.UTF-8";
|
||||||
|
LC_TIME = "en_US.UTF-8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Security
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
|
users.users.twoneis = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "twoneis";
|
||||||
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Use zsh
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
}
|
16
outputs.nix
16
outputs.nix
|
@ -1,6 +1,6 @@
|
||||||
{ nixpkgs, home-manager, nixos-hardware, nur, niri, ... }@inputs: {
|
{ nixpkgs, home-manager, nixos-hardware, nur, niri, ... }@inputs: {
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
commonModules = [
|
clientModules = [
|
||||||
./modules/system
|
./modules/system
|
||||||
niri.nixosModules.default
|
niri.nixosModules.default
|
||||||
home-manager.nixosModules.home-manager {
|
home-manager.nixosModules.home-manager {
|
||||||
|
@ -14,19 +14,29 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
serverModules = [
|
||||||
|
./modules/server
|
||||||
|
];
|
||||||
in {
|
in {
|
||||||
desktop = nixpkgs.lib.nixosSystem {
|
desktop = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./devices/desktop
|
./devices/desktop
|
||||||
] ++ commonModules;
|
] ++ clientModules;
|
||||||
};
|
};
|
||||||
|
|
||||||
surface = nixpkgs.lib.nixosSystem {
|
surface = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./devices/surface
|
./devices/surface
|
||||||
] ++ commonModules;
|
] ++ clientModules;
|
||||||
|
};
|
||||||
|
|
||||||
|
zotac-mini = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./devices/zotac-mini
|
||||||
|
] ++ serverModules;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue