Split configuration

This commit is contained in:
Cyryl Płotnicki 2019-04-21 10:18:35 +01:00
parent 4268cd6cba
commit 069ed5fc22
6 changed files with 81 additions and 54 deletions

22
nixos/boot.nix Normal file
View file

@ -0,0 +1,22 @@
{ config, pkgs, ... }:
{
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
boot = {
initrd.luks.devices = [
{
name = "root";
device = "/dev/disk/by-uuid/8c76bf01-59b3-4c60-b853-e9cb77f3ca14";
preLVM = true;
allowDiscards = true;
}
];
loader.grub = {
enable = true;
version = 2;
device = "nodev";
efiSupport = true;
};
loader.efi.canTouchEfiVariables = true;
};
}

4
nixos/boxes/skinnyv.nix Normal file
View file

@ -0,0 +1,4 @@
{ config, pkgs, ... }:
{
networking.hostName = "skinnyv";
}

View file

@ -8,12 +8,17 @@ in
[
/etc/nixos/hardware-configuration.nix
./vscode.nix
./syncthing.nix
./gsconnect.nix
./gfx.nix
./boot.nix
./boxes/skinnyv.nix # TODO: invert relationship
];
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
unstable = import unstableTarball {
config = config.nixpkgs.config;
};
@ -25,19 +30,8 @@ in
environment.systemPackages = with pkgs; [
wget git zsh gnupg curl tmux python36Packages.glances
gnomeExtensions.gsconnect
(
vim_configurable.override {
python = python3;
}
)
];
networking.hostName = "skinnyv";
# gsconnect
networking.firewall.allowedTCPPortRanges = [ { from = 1716; to = 1764; } ];
networking.firewall.allowedUDPPortRanges = [ { from = 1716; to = 1764; } ];
i18n.defaultLocale = "en_GB.UTF-8";
users.users.cyryl = {
@ -66,7 +60,6 @@ in
enableHardening = false; #needed for 3D acceleration
};
virtualisation.docker = {
enable = true;
autoPrune.enable = true;
@ -84,13 +77,6 @@ in
nssmdns = true;
};
syncthing = {
enable = true;
user = "cyryl";
dataDir = "/home/cyryl/.syncthing";
openDefaultPorts = true;
};
restic.backups.home = {
passwordFile = "/etc/nixos/secrets/restic-password";
paths = [ "/home" ];
@ -124,42 +110,8 @@ in
hardware.u2f.enable = true;
hardware.brightnessctl.enable = true;
hardware.cpu.intel.updateMicrocode = true;
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-media-driver
];
};
hardware.sane.enable = true;
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
boot = {
initrd.luks.devices = [
{
name = "root";
device = "/dev/disk/by-uuid/8c76bf01-59b3-4c60-b853-e9cb77f3ca14";
preLVM = true;
allowDiscards = true;
}
];
loader.grub = {
enable = true;
version = 2;
device = "nodev";
efiSupport = true;
};
loader.efi.canTouchEfiVariables = true;
kernelParams = [
"i915.enable_rc6=7"
];
};
nix.gc.automatic = true;
system.autoUpgrade.enable = true;
system.stateVersion = "18.09";

27
nixos/gfx.nix Normal file
View file

@ -0,0 +1,27 @@
{ config, pkgs, ... }:
{
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
intel-media-driver
];
};
nixpkgs.config = {
packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
};
boot = {
kernelParams = [
"i915.enable_rc6=7"
];
};
}

13
nixos/gsconnect.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
networking.firewall.allowedTCPPortRanges = [ { from = 1716; to = 1764; } ];
networking.firewall.allowedUDPPortRanges = [ { from = 1716; to = 1764; } ];
environment.systemPackages = with pkgs; [
gnomeExtensions.gsconnect
(
vim_configurable.override {
python = python3;
}
)
];
}

9
nixos/syncthing.nix Normal file
View file

@ -0,0 +1,9 @@
{ config, pkgs, ... }:
{
services.syncthing = {
enable = true;
user = "cyryl";
dataDir = "/home/cyryl/.syncthing";
openDefaultPorts = true;
};
}