Flake : Split common module.
This commit is contained in:
parent
94b868bf93
commit
fc12df047d
|
@ -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
|
||||
|
|
6
.config/linux/system/module/common/Bootloader.nix
Normal file
6
.config/linux/system/module/common/Bootloader.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
5
.config/linux/system/module/common/Firewall.nix
Normal file
5
.config/linux/system/module/common/Firewall.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.firewall.enable = false;
|
||||
}
|
|
@ -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;
|
||||
}
|
5
.config/linux/system/module/common/Ld.nix
Normal file
5
.config/linux/system/module/common/Ld.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.nix-ld.enable = true;
|
||||
}
|
17
.config/linux/system/module/common/Locale.nix
Normal file
17
.config/linux/system/module/common/Locale.nix
Normal 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";
|
||||
};
|
||||
}
|
5
.config/linux/system/module/common/Network.nix
Normal file
5
.config/linux/system/module/common/Network.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.networkmanager.enable = true;
|
||||
}
|
6
.config/linux/system/module/common/Nix.nix
Normal file
6
.config/linux/system/module/common/Nix.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
40
.config/linux/system/module/common/Packages.nix
Normal file
40
.config/linux/system/module/common/Packages.nix
Normal 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
|
||||
];
|
||||
}
|
5
.config/linux/system/module/common/Root.nix
Normal file
5
.config/linux/system/module/common/Root.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
users.users.root.hashedPassword = "$y$j9T$oqCB16i5E2t1t/HAWaFd5.$tTaHtAcifXaDVpTcRv.yH2/eWKxKE9xM8KcqXHfHrD7"; # Use `mkpasswd`.
|
||||
}
|
5
.config/linux/system/module/common/Swap.nix
Normal file
5
.config/linux/system/module/common/Swap.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
zramSwap.enable = true;
|
||||
}
|
5
.config/linux/system/module/common/Users.nix
Normal file
5
.config/linux/system/module/common/Users.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
users.mutableUsers = false;
|
||||
}
|
Reference in a new issue