style: giveing some order in this configuration
This commit is contained in:
parent
7ff9e5b7cf
commit
18060e87db
4 changed files with 97 additions and 96 deletions
138
hosts/fix/configuration.nix
Normal file
138
hosts/fix/configuration.nix
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../global.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "nixos-fix";
|
||||
firewall.enable = false;
|
||||
networkmanager.enable = true;
|
||||
wireless.enable = false;
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
ticket = {
|
||||
description = "Service for ticket";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "root";
|
||||
WorkingDirectory = "/root/ticket";
|
||||
ExecStart = "${pkgs.nodejs}/bin/npm start";
|
||||
Environment = "PATH=${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.nodejs}/bin";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
tempvoc = {
|
||||
description = "Service for tempvoc";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "root";
|
||||
WorkingDirectory = "/root/tempvoc";
|
||||
ExecStart = "${pkgs.nodejs}/bin/npm start";
|
||||
Environment = "PATH=${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.nodejs}/bin";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
music = {
|
||||
description = "Service for music";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "root";
|
||||
WorkingDirectory = "/root/music";
|
||||
ExecStart = "${pkgs.nodejs}/bin/npm start";
|
||||
Environment = "PATH=${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.nodejs}/bin";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
yagpdb = {
|
||||
description = "Service for yagpdb";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "root";
|
||||
WorkingDirectory = "/root/yagpdb/cmd/yagpdb";
|
||||
ExecStart = "/root/yagpdb/cmd/yagpdb/yagpdb -all -pa";
|
||||
EnvironmentFile = "/root/yagpdb/cmd/yagpdb/sampleenvfile";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
steam = {
|
||||
enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
};
|
||||
gamemode.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
ports = [ 42131 ];
|
||||
};
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
nginx = {
|
||||
virtualHosts = {
|
||||
"enium.eu" = {
|
||||
forceSSL = true;
|
||||
sslCertificate = "/etc/nginx/ssl/selfsigned.crt";
|
||||
sslCertificateKey = "/etc/nginx/ssl/selfsigned.key";
|
||||
};
|
||||
};
|
||||
};
|
||||
udev.extraRules = ''
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="5740", MODE="0666"
|
||||
'';
|
||||
redis.servers."" = {
|
||||
enable = true;
|
||||
};
|
||||
postgresql = {
|
||||
enable = true;
|
||||
};
|
||||
greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default_session = {
|
||||
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --remember-user-session --time --cmd Hyprland";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
config.common.default = "*";
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
70
hosts/fix/hardware-configuration.nix
Normal file
70
hosts/fix/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# services.dbus.enable = true;
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
];
|
||||
kernelModules = [];
|
||||
};
|
||||
kernelModules = [
|
||||
"kvm-intel"
|
||||
];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/a943d592-57d3-497e-bf43-49b50ac73f0b";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/5AAB-0026";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0077"
|
||||
"dmask=0077"
|
||||
];
|
||||
};
|
||||
"/mnt/data" = {
|
||||
device = "/dev/disk/by-uuid/5729d30c-5806-4ccd-8a2a-080a258084dc";
|
||||
fsType = "ext4";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.docker0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
open = false;
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
85
hosts/global.nix
Normal file
85
hosts/global.nix
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
documentation = {
|
||||
enable = true;
|
||||
man.enable = true;
|
||||
dev.enable = true;
|
||||
};
|
||||
time.timeZone = "Europe/Paris";
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "fr_FR.UTF-8";
|
||||
LC_IDENTIFICATION = "fr_FR.UTF-8";
|
||||
LC_MEASUREMENT = "fr_FR.UTF-8";
|
||||
LC_MONETARY = "fr_FR.UTF-8";
|
||||
LC_NAME = "fr_FR.UTF-8";
|
||||
LC_NUMERIC = "fr_FR.UTF-8";
|
||||
LC_PAPER = "fr_FR.UTF-8";
|
||||
LC_TELEPHONE = "fr_FR.UTF-8";
|
||||
LC_TIME = "fr_FR.UTF-8";
|
||||
};
|
||||
};
|
||||
users = {
|
||||
defaultUserShell = pkgs.zsh;
|
||||
users = {
|
||||
raphael = {
|
||||
isNormalUser = true;
|
||||
description = "The main account of raphael";
|
||||
useDefaultShell = true;
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"dialout"
|
||||
"plugdev"
|
||||
"wheel"
|
||||
"docker"
|
||||
"video"
|
||||
];
|
||||
packages = with pkgs; [
|
||||
home-manager
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.extraOptions = ''experimental-features = nix-command flakes'';
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
bat
|
||||
cairo
|
||||
dconf
|
||||
fastfetch
|
||||
git
|
||||
go
|
||||
home-manager
|
||||
lego
|
||||
libjpeg
|
||||
libpng
|
||||
libuuid
|
||||
linux-manual
|
||||
man
|
||||
man-pages
|
||||
man-pages-posix
|
||||
networkmanager
|
||||
nodejs
|
||||
openssl
|
||||
pkg-config
|
||||
postgresql
|
||||
protonup
|
||||
python3
|
||||
python3Packages.pip
|
||||
qflipper
|
||||
tmux
|
||||
unzip
|
||||
wget
|
||||
wl-clipboard
|
||||
xclip
|
||||
xsel
|
||||
yarn
|
||||
zsh
|
||||
vim
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue