common: move to modules, move some files out, modules: adjust dir structure
This commit is contained in:
parent
ed5f8c3ae6
commit
0bc9abc4c0
43 changed files with 86 additions and 83 deletions
14
modules/common/boot.nix
Executable file
14
modules/common/boot.nix
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
configurationLimit = 5;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/common/default-packages.nix
Normal file
5
modules/common/default-packages.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
environment.defaultPackages = lib.mkForce [];
|
||||
}
|
||||
|
|
@ -1,8 +1,12 @@
|
|||
{ config, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./stylix.nix
|
||||
./yubikey.nix
|
||||
./boot.nix
|
||||
./default-packages.nix
|
||||
./locales.nix
|
||||
./networking.nix
|
||||
./nix.nix
|
||||
./users.nix
|
||||
];
|
||||
}
|
||||
20
modules/common/locales.nix
Executable file
20
modules/common/locales.nix
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
}
|
||||
5
modules/common/networking.nix
Executable file
5
modules/common/networking.nix
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
{ hostName, config, ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "${hostName}";
|
||||
}
|
||||
18
modules/common/nix.nix
Executable file
18
modules/common/nix.nix
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
nix = {
|
||||
channel.enable = false;
|
||||
gc.automatic = true;
|
||||
optimise = {
|
||||
automatic = true;
|
||||
dates = [ "weekly" ];
|
||||
};
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
download-buffer-size = 524288000;
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
}
|
||||
12
modules/common/users.nix
Executable file
12
modules/common/users.nix
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
{ hostName, config, ... }:
|
||||
|
||||
{
|
||||
users.users.wo2w = {
|
||||
isNormalUser = true;
|
||||
description = "${hostName}";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
|
||||
# make new user logins (iso/vm/new machine) use a default password
|
||||
initialPassword = "1234";
|
||||
};
|
||||
}
|
||||
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./bash.nix
|
||||
./gaming.nix
|
||||
./kde.nix
|
||||
# ./niri.nix
|
||||
./tailscale.nix
|
||||
./programs
|
||||
./services
|
||||
./system
|
||||
];
|
||||
}
|
||||
11
modules/nixos/programs/default.nix
Normal file
11
modules/nixos/programs/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./bash.nix
|
||||
./gaming.nix
|
||||
./git.nix
|
||||
./kde.nix
|
||||
./ssh.nix
|
||||
];
|
||||
}
|
||||
26
modules/nixos/programs/ssh.nix
Executable file
26
modules/nixos/programs/ssh.nix
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ssh = {
|
||||
startAgent = true;
|
||||
enableAskPassword = true;
|
||||
extraConfig = "
|
||||
IdentityFile /home/wo2w/.ssh/ssh-key
|
||||
User wo2w
|
||||
Host gameserver
|
||||
Hostname 192.168.2.221
|
||||
Port 22
|
||||
Host Swordsmachine
|
||||
Hostname 192.168.2.84
|
||||
Port 8743
|
||||
Host Earthmover
|
||||
Hostname 192.168.2.87
|
||||
Port 8743
|
||||
";
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = if config.services.desktopManager.plasma6.enable then with pkgs; [ kdePackages.ksshaskpass ] else [];
|
||||
variables.SSH_ASKPASS_REQUIRE = "prefer";
|
||||
};
|
||||
}
|
||||
9
modules/nixos/services/default.nix
Normal file
9
modules/nixos/services/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./mumble.nix
|
||||
./openssh.nix
|
||||
./tailscale.nix
|
||||
];
|
||||
}
|
||||
14
modules/nixos/services/openssh.nix
Executable file
14
modules/nixos/services/openssh.nix
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 8743 ];
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
AllowUsers = [ "wo2w" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
12
modules/nixos/system/default.nix
Normal file
12
modules/nixos/system/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./desktop.nix
|
||||
./home-manager.nix
|
||||
./scx.nix
|
||||
./stylix.nix
|
||||
./swap.nix
|
||||
./yubikey.nix
|
||||
];
|
||||
}
|
||||
40
modules/nixos/system/desktop.nix
Executable file
40
modules/nixos/system/desktop.nix
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
hardware = {
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
|
||||
# mesa graphics library
|
||||
graphics.enable = true;
|
||||
};
|
||||
|
||||
# audio
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
|
||||
# CUPS
|
||||
services.printing.enable = true;
|
||||
|
||||
# enable native wayland in chromium/electron
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
bitwarden
|
||||
krita
|
||||
vlc
|
||||
gpu-screen-recorder-gtk
|
||||
];
|
||||
|
||||
# needed alongside the GUI app for promptless recording
|
||||
programs.gpu-screen-recorder.enable = true;
|
||||
}
|
||||
18
modules/nixos/system/home-manager.nix
Executable file
18
modules/nixos/system/home-manager.nix
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
{ inputs, config, ... }:
|
||||
|
||||
{
|
||||
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
backupFileExtension = "bak";
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users.wo2w = {
|
||||
home = {
|
||||
username = "wo2w";
|
||||
homeDirectory = "/home/wo2w";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/nixos/system/scx.nix
Normal file
10
modules/nixos/system/scx.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.scx = {
|
||||
enable = true;
|
||||
package = pkgs.scx.rustscheds;
|
||||
# use gaming performance scheduler
|
||||
scheduler = "scx_lavd";
|
||||
};
|
||||
}
|
||||
8
modules/nixos/system/swap.nix
Executable file
8
modules/nixos/system/swap.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
swapDevices = [ {
|
||||
device = "/var/swapfile";
|
||||
size = 16*1024;
|
||||
} ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue