refactore directory structure

This commit is contained in:
Chris Cochrun 2023-06-09 06:06:37 -05:00
parent 3830eef1f4
commit e87bfb7c39
485 changed files with 66 additions and 1696 deletions

View file

@ -0,0 +1,376 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/base.nix
../../modules/servers.nix
../../pkgs/base-packages.nix
];
networking.hostName = "dalinar"; # Define your hostname.
# Enable the X11 windowing system.
# services.xserver.enable = true;
# Configure keymap in X11
# services.xserver.layout = "us";
# services.xserver.xkbOptions = {
# "eurosign:e";
# "caps:escape" # map caps to escape.
# };
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.chris = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
};
virtualisation.docker.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
services.syncthing = {
enable = true;
dataDir = "/storage/syncthing";
openDefaultPorts = true;
configDir = "/home/chris/syncthing";
user = "chris";
group = "users";
guiAddress = "0.0.0.0:8384";
devices = {
syl = {
id = "AJMADOK-TENODAA-VSOEW2A-4RXY2XI-YNHIS7H-H3ZYAO5-3UQ64EE-O2N5BAY";
};
kaladin = {
id = "LH6523Z-QQ5F3A4-SINZDOI-UFMQBIX-ZV6Q5BQ-LTKVMDB-CRI6QG5-RRKJFQS";
};
shadow = {
id = "SGO2BUT-WDOB2B7-SD5BHKU-ES3BFZF-EZPFSQJ-B4744TP-SXKZS4O-SDLJ5QX";
};
tablet = {
id = "4HEXCNH-MCVBZQX-LQ735TG-P2VTJ7N-CZ5MK4P-ICZAPC7-YCXVEWV-7NILMA5";
};
kohlin = {
id = "BSWKBRR-2IJBCHA-UQY7DE7-CV2U2IL-PMFQFCJ-D5ZZJMU-FPYRUPC-MCC32QQ";
};
};
folders = {
music = {
id = "teqqy-rzvec";
path = "/storage/syncthing/Music";
devices = [ "syl" "kaladin" "shadow" "kohlin"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
ebooks = {
id = "wziqy-7hyv9";
path = "/storage/syncthing/ebooks";
devices = [ "syl" "kaladin" "shadow" "tablet" "kohlin"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
notes = {
id = "zwshm-umwbt";
path = "/storage/syncthing/notes";
devices = [ "syl" "kaladin" "shadow" "kohlin"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
librera = {
id = "vvtvj-osndy";
path = "/storage/syncthing/librera";
devices = [ "tablet" "shadow" "kohlin"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
};
};
nix-bitcoin = {
generateSecrets = true;
operator = {
enable = false;
name = "chris";
};
};
# List services that you want to enable:
services.locate = {
enable = true;
locate = pkgs.plocate;
localuser = null;
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.fstrim.enable = true;
services.logind = {
lidSwitch = "ignore";
lidSwitchExternalPower = "ignore";
};
services.monero = {
enable = false;
dataDir = "/storage/monero";
};
services.bitcoind = {
enable = false;
listen = true;
dataDir = "/storage/bitcoind";
dbCache = 5000;
};
services.clightning = {
enable = false;
dataDir = "/storage/clightning";
};
services.rtl = {
enable = false;
dataDir = "/storage/rtl";
nightTheme = true;
extraCurrency = "USD";
nodes.clightning.enable = true;
};
#mailserver = {
# enable = true;
# fqdn = "mail.cochrun.xyz";
# domains = [ "cochrun.xyz" ];
# enableManageSieve = true;
# mailDirectory = "/storage/vmail";
# mailboxes = {
# Archive = {
# auto = "subsribe";
# specialUse = "Archive";
# }
# Drafts = {
# auto = "subscribe";
# specialUse = "Drafts";
# };
# Junk = {
# auto = "subscribe";
# specialUse = "Junk";
# };
# Sent = {
# auto = "subscribe";
# specialUse = "Sent";
# };
# Trash = {
# auto = "no";
# specialUse = "Trash";
# };
# };
# useFsLayout = true;
# hierarchySeparator = "/";
# certificateScheme = 1;
# certificateFile = "/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/mail.cochrun.xyz/mail.cochrun.xyz.crt";
# keyFile = "/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/mail.cochrun.xyz/mail.cochrun.xyz.key";
# loginAccounts = {
# "chris@cochrun.xyz" = {
# hashedPasswordFile = "/home/chris/mailp";
# aliases = [
# "postmaster@cochrun.xyz"
# "cxda@cochrun.xyz"
# "ceth@cochrun.xyz"
# "clocb@cochrun.xyz"
# "higdry@cochrun.xyz"
# "clin@cochrun.xyz"
# ]
# }
# }
#}
# DDCLIENT
services.ddclient = {
enable = true;
configFile = /home/chris/ddclient.conf;
#domains = [
# "nc.cochrun.xyz"
# "home.cochrun.xyz"
# "mail.cochrun.xyz"
# "jelly.cochrun.xyz"
#];
#passwordFile = "/etc/nixos/ddclientp";
#protocol = "namecheap";
#use = "web, web=dynamicdns.park-your-domain.com/getip";
#server = "dynamicdns.park-your-domain.com";
#username = "cochrun.xyz";
#extraConfig = ''
#use=web, web=dynamicdns.park-your-domain.com/getip
#protocol=namecheap
#server=dynamicdns.park-your-domain.com
#login=livingseedco.shop
#password=e157e42337fc4ccd850d0a3904733f46
#@
#use=web, web=dynamicdns.park-your-domain.com/getip
#protocol=namecheap
#server=dynamicdns.park-your-domain.com
#login=cochrun.xyz
#password=94602c373f9f4743838bf567def2eb72
#@,nc.cochrun.xyz,home.cochrun.xyz,mail.cochrun.xyz,jelly.cochrun.xyz
#'';
};
# CADDY
services.caddy = {
enable = true;
email = "chris@tfcconnection.org";
virtualHosts = {
"home.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:8123
'';
};
# virtualHosts = {
# "mail.cochrun.xyz".extraConfig = ''
# '';
# };
virtualHosts = {
"jelly.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:8096
'';
};
#virtualHosts = {
# "livingseedco.shop".extraConfig = ''
# reverse_proxy localhost:8282
# '';
#};
virtualHosts = {
"sonarr.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:7879
'';
};
virtualHosts = {
"radarr.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:7878
'';
};
virtualHosts = {
"192.168.1.2".extraConfig = ''
reverse_proxy localhost:9091
'';
};
virtualHosts = {
"rtl.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:3000
'';
};
virtualHosts = {
"ombi.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:3579
'';
};
virtualHosts = {
"workout.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:8001
header {
Access-Control-Allow-Origin *
}
'';
};
virtualHosts = {
"truthmatters.cc".extraConfig = ''
encode gzip
root * /srv/truthmatters
file_server
header {
Access-Control-Allow-Origin *
}
'';
};
virtualHosts = {
"new.luctorcrc.org".extraConfig = ''
encode gzip
root * /srv/luctorcrc
file_server
header {
Access-Control-Allow-Origin *
}
'';
};
virtualHosts = {
"nc.cochrun.xyz".extraConfig = ''
reverse_proxy localhost:8080
encode gzip
redir /.well-known/carddav /remote.php/carddav 301
redir /.well-known/caldav /remote.php/caldav 301
header Strict-Transport-Security "max-age=15768000; includeSubDomains; reload;"
'';
};
};
systemd.services = {
# mail-cert-renew = {
# enable = true;
# serviceConfig = {
# Type = "oneshot";
# ExecStart = with pkgs.docker "sh -c /home/chris/bin/mail-cert-renew";
# };
# };
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment?
# The nix-bitcoin release version that your config is compatible with.
# When upgrading to a backwards-incompatible release, nix-bitcoin will display an
# an error and provide instructions for migrating your config to the new release.
nix-bitcoin.configVersion = "0.0.77";
}

View file

@ -0,0 +1,44 @@
# 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")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/103a24d5-ffb5-4f7c-ab68-48e0b766b3ac";
fsType = "btrfs";
options = [ "subvol=@" "noatime" "nodiratime" "compress=zstd" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/55C5-7725";
fsType = "vfat";
};
fileSystems."/storage" =
{ device = "/dev/disk/by-uuid/f1804953-14e5-42db-a974-1e18f16d884c";
fsType = "btrfs";
options = [ "noatime" "nodiratime" "compress=zstd" ];
};
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.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,100 @@
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
../../pkgs/base-packages.nix
../../pkgs/desktop-packages.nix
../../modules/emacs.nix
../../modules/desktop.nix
../../modules/base.nix
];
networking.hostName = "kaladin"; # Define your hostname.
networking.interfaces.enp0s31f6.useDHCP = true;
networking.interfaces.wlp7s0.useDHCP = true;
# NVIDIA
# services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
opengl = {
enable = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
mesa.drivers
vaapiVdpau
libvdpau-va-gl
];
};
# nvidia = {
# package = config.boot.kernelPackages.nvidiaPackages.beta;
# modesetting.enable = true;
# powerManagement.enable = true;
# };
};
# services.xserver.screenSection = ''
# Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
# Option "AllowIndirectGLXProtocol" "off"
# Option "TripleBuffer" "on"
# '';
# Define a user account. Don't forget to set a password with passwd.
users.users.chris = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "input" "no-internet" ]; # Enable sudo for the user.
};
# virtualisation.waydroid.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# services.caddy = {
# enable = true;
# virtualHosts = {
# "videosdani.tfcconnection.org".extraConfig = ''
# reverse_proxy localhost:9000
# '';
# };
# virtualHosts = {
# "videosdani.tfcconnection.org:1935".extraConfig = ''
# reverse_proxy localhost:1935
# '';
# };
# };
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
}

View file

@ -0,0 +1,65 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@home" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@nix" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/var/log" =
{ device = "/dev/disk/by-uuid/9b5a1a62-0de6-4e07-a541-634736980d10";
fsType = "btrfs";
options = [ "subvol=@log" "noatime" "ssd" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/run/media/chris/Storage" =
{ device = "/dev/disk/by-uuid/4c7d4273-7b72-4aa8-8e1c-e281543d06cb";
fsType = "btrfs";
options = [ "noatime" "space_cache" "clear_cache" "compress=zstd" ];
};
fileSystems."/run/media/chris/backup" =
{ device = "/dev/disk/by-uuid/4286b9ef-e8ed-49a0-9eec-91b8ee05b2cb";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/35A0-C1F1";
fsType = "vfat";
};
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.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,190 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/base.nix
../../modules/servers.nix
../../pkgs/base-packages.nix
];
boot.loader.efi.efiSysMountPoint = "/boot/efi";
networking.hostName = "kohlin"; # Define your hostname.
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
};
# Define a user account. Don't forget to set a password with passwd.
users.users = {
chris = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
};
};
virtualisation.docker.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
services.syncthing = {
enable = true;
dataDir = "/storage/syncthing";
openDefaultPorts = true;
configDir = "/home/chris/syncthing";
user = "chris";
group = "users";
guiAddress = "0.0.0.0:8384";
devices = {
syl = {
id = "AJMADOK-TENODAA-VSOEW2A-4RXY2XI-YNHIS7H-H3ZYAO5-3UQ64EE-O2N5BAY";
};
kaladin = {
id = "LH6523Z-QQ5F3A4-SINZDOI-UFMQBIX-ZV6Q5BQ-LTKVMDB-CRI6QG5-RRKJFQS";
};
shadow = {
id = "SGO2BUT-WDOB2B7-SD5BHKU-ES3BFZF-EZPFSQJ-B4744TP-SXKZS4O-SDLJ5QX";
};
tablet = {
id = "4HEXCNH-MCVBZQX-LQ735TG-P2VTJ7N-CZ5MK4P-ICZAPC7-YCXVEWV-7NILMA5";
};
dalinar = {
id = "I6BKBTH-EYKIX5P-GRN6WY5-JHZNFM2-PKMNYU7-Q6JQQY5-EBEWSHO-XGZINAR";
};
};
folders = {
music = {
id = "teqqy-rzvec";
path = "/storage/syncthing/Music";
devices = [ "syl" "kaladin" "shadow" "dalinar"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
ebooks = {
id = "wziqy-7hyv9";
path = "/storage/syncthing/ebooks";
devices = [ "syl" "kaladin" "shadow" "tablet" "dalinar"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
notes = {
id = "zwshm-umwbt";
path = "/storage/syncthing/notes";
devices = [ "syl" "kaladin" "shadow" "dalinar"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
librera = {
id = "vvtvj-osndy";
path = "/storage/syncthing/librera";
devices = [ "tablet" "shadow" "dalinar"];
versioning = {
type = "trashcan";
params.cleanoutDays = "100";
};
};
};
};
# List services that you want to enable:
nix-bitcoin = {
generateSecrets = true;
operator = {
enable = true;
name = "chris";
};
};
services.locate = {
enable = true;
locate = pkgs.plocate;
localuser = null;
};
services.openssh.enable = true;
services.fstrim.enable = true;
services.logind = {
lidSwitch = "ignore";
lidSwitchExternalPower = "ignore";
};
services.monero = {
enable = false;
dataDir = "/storage/monero";
};
services.bitcoind = {
enable = true;
listen = true;
dataDir = "/storage/bitcoind";
dbCache = 3000;
};
services.clightning = {
enable = true;
dataDir = "/storage/clightning";
};
services.rtl = {
enable = true;
dataDir = "/storage/rtl";
nightTheme = true;
extraCurrency = "USD";
nodes.clightning.enable = true;
};
# CADDY
services.caddy = {
enable = true;
};
systemd.services = {
# mail-cert-renew = {
# enable = true;
# serviceConfig = {
# Type = "oneshot";
# ExecStart = with pkgs.docker "sh -c /home/chris/bin/mail-cert-renew";
# };
# };
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment?
}

View file

@ -0,0 +1,40 @@
# 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")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/3dc76272-54d9-445e-846f-591cd407b085";
fsType = "ext4";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/DDA5-32A1";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b25464c5-2268-4963-80cb-6dc51dcba91b"; }
];
# 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.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

13
systems/syl/cachix.nix Normal file
View file

@ -0,0 +1,13 @@
# WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }:
let
folder = ./cachix;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in {
inherit imports;
nix.settings.substituters = ["https://cache.nixos.org/"];
}

View file

@ -0,0 +1,11 @@
{
nix = {
settings.substituters = [
"https://nix-community.cachix.org"
];
settings.trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}

View file

@ -0,0 +1,115 @@
{ lib, config, pkgs, callPackage, ... }:
{
imports =
[
./hardware-configuration.nix
../../cachix/default.nix
../../pkgs/base-packages.nix
../../pkgs/desktop-packages.nix
../../modules/base.nix
../../modules/emacs.nix
../../modules/desktop.nix
];
networking.hostName = "syl"; # Define your hostname.
boot.initrd.kernelModules = [ "i915" ];
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.acpilight.enable = lib.mkDefault true;
networking.interfaces.wlp170s0.useDHCP = true;
hardware.uinput.enable = true;
hardware.bluetooth.enable = true;
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
services.xserver.videoDrivers = ["intel"];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
};
systemd.services.display-manager = {
wants = [ "systemd-user-sessions.service" "multi-user.target" "network-online.target" ];
after = [ "systemd-user-sessions.service" "multi-user.target" "network-online.target" ];
};
# Enable fingerprint
services.fprintd.enable = true;
# Some other things
services.thermald.enable = true;
services.power-profiles-daemon.enable = false;
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC="performance";
CPU_SCALING_GOVERNOR_ON_BAT="powersave";
CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance";
CPU_ENERGY_PERF_POLICY_ON_BAT="power";
PCIE_ASPM_ON_AC="default";
PCIE_ASPM_ON_BAT="powersupersave";
SCHED_POWERSAVE_ON_AC=0;
SCHED_POWERSAVE_ON_BAT=1;
START_CHARGE_THRESH_BAT1=70;
STOP_CHARGE_THRESH_BAT1=80;
USB_ALLOWLIST="32ac:0002";
};
};
# Enable touchpad support (enabled default in most desktopManager).
services.xserver.libinput.enable = true;
services.xserver.dpi = 144;
# Define a user account. Don't forget to set a password with passwd.
users.users.chris = {
isNormalUser = true;
extraGroups = [ "adbusers" "wheel" "networkmanager" "input" "uinput" ];
};
services.fwupd.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
services.locate = {
enable = true;
locate = pkgs.plocate;
localuser = null;
interval = "hourly";
prunePaths = [ "/tmp" "/nix/store" "/nix/var/log/nix" "/etc" "/bin" "/boot" "/usr" "/var" "/run" "/srv" "/sys" "/root" "/proc" "/opt" "/dev" "/home/chris/.emacs.d" "/home/chris/.config" "/home/chris/.nix-profile" "/home/chris/.profile" "/home/chris/dev/nixpkgs" "/home/chris/.cache" "/home/chris/.local" "/home/chris/.dotemacs" "/home/chris/.cargo" "/home/chris/.mozilla" "/home/chris/.var" "/home/chris/.dotfiles" "/home/chris/.dbus" "/home/chris/.android" "/var/lib"];
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
}

View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "acpi_call" ];
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
boot.loader.efi.efiSysMountPoint = "/boot/efi";
zramSwap.enable = true;
fileSystems."/" =
{ device = "/dev/disk/by-uuid/db28ba7c-a15d-4c81-8373-99f2f171cac5";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/BA76-3723";
fsType = "vfat";
};
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.wlp170s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# high-resolution display
# hardware.video.hidpi.enable = lib.mkDefault true;
}