Flake : Split common module.

This commit is contained in:
Dmitry Voronin 2024-01-31 02:53:37 +03:00
parent 94b868bf93
commit fc12df047d
12 changed files with 120 additions and 86 deletions

View file

@ -2,11 +2,25 @@
# inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "github:nixos/nixpkgs/952b64947e0b1300600dda555db35d09122b9612"; # NOTE: This is due to AMDGPU bug: https://github.com/NixOS/nixpkgs/issues/284403
outputs = { self, nixpkgs }@inputs: {
nixosModules.common.imports = [
./module/common/Bootloader.nix
./module/common/Firewall.nix
./module/common/Kernel.nix
./module/common/Ld.nix
./module/common/Locale.nix
./module/common/Network.nix
./module/common/Nix.nix
./module/common/Packages.nix
./module/common/Root.nix
./module/common/Swap.nix
./module/common/Users.nix
];
nixosConfigurations.dasha = nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.common
./host/dasha/Configuration.nix
./module/AmdGpu.nix
./module/Common.nix
./module/Dasha.nix
./module/DockerRootless.nix
./module/Flatpak.nix
@ -21,9 +35,9 @@
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.common
./host/desktop/Configuration.nix
./module/AmdGpu.nix
./module/Common.nix
./module/DockerRootless.nix
./module/Flatpak.nix
./module/Gnome.nix
@ -38,9 +52,9 @@
nixosConfigurations.home = nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.common
./host/home/Configuration.nix
./module/AmdGpu.nix
./module/Common.nix
./module/Docker.nix
./module/Flatpak.nix
./module/Ftpd.nix
@ -55,9 +69,9 @@
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.common
./host/laptop/Configuration.nix
./module/AmdGpu.nix
./module/Common.nix
./module/Dasha.nix
./module/DockerRootless.nix
./module/Flatpak.nix
@ -73,8 +87,8 @@
nixosConfigurations.work = nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.common
./host/work/Configuration.nix
./module/Common.nix
./module/DockerRootless.nix
./module/Flatpak.nix
./module/Gnome.nix

View file

@ -0,0 +1,6 @@
{ ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
networking.firewall.enable = false;
}

View file

@ -1,55 +1,7 @@
# Help: man configuration.nix or https://nixos.org/nixos/options.html
{ config, pkgs, stdenv, lib, ... }:
{ pkgs, ... }:
{
# System packages.
environment.systemPackages = with pkgs; [
android-tools
appimage-run
binwalk
btop
cryptsetup
ddrescue
distrobox
gcc
git
jdk11
jdk19
lm_sensors
lshw
gnome.gnome-tweaks
gnumake
imagemagick
lsof
ncdu
neovim
nmap
parallel
pv
ripgrep
scanmem
smartmontools
steam-run
sqlite
testdisk
tmux
tree
virt-manager
wget
wl-clipboard
zip unzip
];
# Root user.
users.mutableUsers = false;
users.users.root.hashedPassword = "$y$j9T$oqCB16i5E2t1t/HAWaFd5.$tTaHtAcifXaDVpTcRv.yH2/eWKxKE9xM8KcqXHfHrD7"; # Use `mkpasswd`.
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Latest kernel.
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
# Sysctl.
@ -106,35 +58,4 @@
"net.ipv6.conf.lo.disable_ipv6" = 1;
"net.ipv6.conf.eth0.disable_ipv6" = 1;
};
# Network.
networking.networkmanager.enable = true;
# Ld.
programs.nix-ld.enable = true;
# Zram.
zramSwap.enable = true;
# Firewall.
networking.firewall.enable = false;
# Locale.
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "ru_RU.UTF-8";
LC_IDENTIFICATION = "ru_RU.UTF-8";
LC_MEASUREMENT = "ru_RU.UTF-8";
LC_MONETARY = "ru_RU.UTF-8";
LC_NAME = "ru_RU.UTF-8";
LC_NUMERIC = "ru_RU.UTF-8";
LC_PAPER = "ru_RU.UTF-8";
LC_TELEPHONE = "ru_RU.UTF-8";
LC_TIME = "ru_RU.UTF-8";
};
# Nix.
nixpkgs.config.allowUnfree = true;
nix.settings.auto-optimise-store = true;
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
programs.nix-ld.enable = true;
}

View file

@ -0,0 +1,17 @@
{ ... }:
{
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "ru_RU.UTF-8";
LC_IDENTIFICATION = "ru_RU.UTF-8";
LC_MEASUREMENT = "ru_RU.UTF-8";
LC_MONETARY = "ru_RU.UTF-8";
LC_NAME = "ru_RU.UTF-8";
LC_NUMERIC = "ru_RU.UTF-8";
LC_PAPER = "ru_RU.UTF-8";
LC_TELEPHONE = "ru_RU.UTF-8";
LC_TIME = "ru_RU.UTF-8";
};
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
networking.networkmanager.enable = true;
}

View file

@ -0,0 +1,6 @@
{ ... }:
{
nixpkgs.config.allowUnfree = true;
nix.settings.auto-optimise-store = true;
}

View file

@ -0,0 +1,40 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
android-tools
appimage-run
binwalk
btop
cryptsetup
ddrescue
distrobox
gcc
git
jdk11
jdk19
lm_sensors
lshw
gnome.gnome-tweaks
gnumake
imagemagick
lsof
ncdu
neovim
nmap
parallel
pv
ripgrep
scanmem
smartmontools
steam-run
sqlite
testdisk
tmux
tree
virt-manager
wget
wl-clipboard
zip unzip
];
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
users.users.root.hashedPassword = "$y$j9T$oqCB16i5E2t1t/HAWaFd5.$tTaHtAcifXaDVpTcRv.yH2/eWKxKE9xM8KcqXHfHrD7"; # Use `mkpasswd`.
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
zramSwap.enable = true;
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
users.mutableUsers = false;
}