This commit is contained in:
Tao Tien 2023-07-11 00:38:39 -07:00
parent ba1f4a32c4
commit a58f8530b7
8 changed files with 219 additions and 9 deletions

14
flake.lock generated
View file

@ -17,16 +17,18 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1688981480,
"narHash": "sha256-AYgIAotBA5C+55PjXKck8cpDgWYrUYsTMpMxH1bZ7/M=",
"owner": "NixOS",
"lastModified": 1688939073,
"narHash": "sha256-jYhYjeK5s6k8QS3i+ovq9VZqBJaWbxm7awTKNhHL9d0=",
"owner": "Nixos",
"repo": "nixpkgs",
"rev": "b9ebd80c7dbcdec2240c5baae334365eaf3d7230",
"rev": "8df7a67abaf8aefc8a2839e0b48f92fdcf69a38b",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "Nixos",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {

View file

@ -2,17 +2,22 @@
description = "we say NO to shitty OSes";
inputs = {
nixpkgs.url = "github:Nixos/nixpkgs/nixos-23.05";
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
outputs = { pkgs, ... }@inputs:
outputs = { nixpkgs, ... }@inputs:
let
# pkgs = import nixpkgs {
# config.allowUnfree = true;
# };
nixosSystem = (systemModules: inputs.nixpkgs.lib.nixosSystem { modules = systemModules; });
base = ./systems/BASED.nix;
nixos-hw = inputs.nixos-hardware.nixosModules;
in
{
nixosConfigurations = {
NOcomputer = pkgs.lib.nixosSystem [
NOcomputer = nixosSystem [
base
nixos-hw.common-cpu-amd
nixos-hw.common-gpu-nvidia
@ -21,7 +26,7 @@
./gaming.nix
./users/tao.nix
];
NOlaptop = pkgs.lib.nixosSystem [
NOlaptop = nixosSystem [
# inputs.nixos-hardware.nixosModules.framework
base
./systems/NOlaptop.nix
@ -31,5 +36,6 @@
];
};
};
}

29
gaming.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
lutris
mangohud
prismlauncher
wine
];
programs.gamemode.enable = true;
programs.steam.enable = true;
security.rtkit.enable = true;
environment.etc =
let
json = pkgs.formats.json { };
in
{
"pipewire/pipewire.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" {
context.properties = {
# default.clock.rate = 48000;
# default.allowed-rates = []
default.clock.quantum = 32;
default.clock.min-quantum = 32;
default.clock.max-quantum = 32;
};
};
};
}

73
systems/BASED.nix Normal file
View file

@ -0,0 +1,73 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
appimage-run
bat
bottom
cifs-utils
du-dust
firefox
git
helix
mpv
nfs-utils
nil
nixpkgs-fmt
onlyoffice-bin
ouch
ripgrep-all
rustup
skim
tree
wezterm
wget
zstd
];
services.tailscale.enable = true;
services.openssh.enable = true;
services.flatpak.enable = true;
services.printing.enable = true;
environment.variables = {
EDITOR = "hx";
VISUAL = "hx";
};
imports = [ ./hardware-configuration.nix ];
hardware.enableAllFirmware = true;
hardware.bluetooth.enable = true;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.networkmanager.enable = true;
networking.firewall.enable = false;
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
services.xserver.layout = "us";
systemd.services.display-manager.restartIfChanged = false;
environment.plasma5.excludePackages = with pkgs.libsForQt5; [
elisa
konsole
];
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
nix.settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
};
nixpkgs.config = { allowUnfree = true; };
time.timeZone = "US/Pacific";
i18n.defaultLocale = "en_US.UTF-8";
system.stateVersion = "23.05";
}

28
systems/NOcomputer.nix Normal file
View file

@ -0,0 +1,28 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
openrgb
gwe
];
fileSystems."/" = { options = [ "noatime" "compress-force=zstd:3" ]; };
fileSystems."/var" = { options = [ "noatime" "compress-force=zstd:3" ]; };
fileSystems."/tmp" = { options = [ "noatime" ]; };
fileSystems."/home" = { options = [ "noatime" "compress-force=zstd:3" ]; };
fileSystems."/home/tao/Games" = { options = [ "nosuid" "nodev" "noatime" "compress-force=zstd:3" "users" "rw" "exec" ]; };
services.udev.packages = [ pkgs.openrgb ];
services.udev.extraRules = ''
SUBSYSTEM=="tty", GROUP="dialout", ATTRS{interface}=="Black Magic GDB Server", SYMLINK+="ttyBmpGdb"
SUBSYSTEM=="tty", GROUP="dialout", ATTRS{interface}=="Black Magic UART Port", SYMLINK+="ttyBmpTarg"
'';
boot.kernelModules = [ "i2c-dev" ];
fonts.fonts = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" ]; })
noto-fonts-cjk
noto-fonts-emoji
];
networking.hostname = "NOcomputer";
}

6
systems/NOlaptop.nix Normal file
View file

@ -0,0 +1,6 @@
{ ... }: {
boot.kernelParams = [
"mem_sleep_default=deep"
"nvme.noacpi=1"
];
}

45
users/tao.nix Normal file
View file

@ -0,0 +1,45 @@
{ pkgs, config, ... }:
let
unstableTarball = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
in
{
users.users.tao.packages = with pkgs; [
deluge
discord
elf2uf2-rs
# fractal
gcc
gdb
keepassxc
libsForQt5.kdeconnect-kde
lldb
nix-prefetch-scripts
openrgb
starship
tio
unstable.nushell
unstable.prusa-slicer
virt-manager
zoxide
];
services.syncthing = {
enable = true;
user = "tao";
dataDir = "/home/tao/Sync";
configDir = "/home/tao/.config/syncthing";
};
nixpkgs.config = {
packageOverrides = pkgs: {
unstable = import unstableTarball {
config = config.nixpkgs.config;
};
};
};
users.users.tao = {
isNormalUser = true;
extraGroups = [ "wheel" "libvirtd" "dialout" ];
};
}

21
uwuraid.nix Normal file
View file

@ -0,0 +1,21 @@
{ ... }: {
services.rpcbind.enable = true;
systemd.mounts = let commonMountOptions = { type = "nfs"; mountConfig = { Options = "noatime"; }; }; in
[
(commonMountOptions // { what = "192.168.86.56:/mnt/user/anime"; where = "/mnt/uwuraid/anime"; })
(commonMountOptions // { what = "192.168.86.56:/mnt/user/backup"; where = "/mnt/uwuraid/backup"; })
(commonMountOptions // { what = "192.168.86.56:/mnt/user/syncthing"; where = "/mnt/uwuraid/syncthing"; })
(commonMountOptions // { what = "192.168.86.56:/mnt/user/television"; where = "/mnt/uwuraid/television"; })
(commonMountOptions // { what = "192.168.86.56:/mnt/user/photos"; where = "/mnt/uwuraid/photos"; })
(commonMountOptions // { what = "192.168.86.56:/mnt/user/movies"; where = "/mnt/uwuraid/movies"; })
];
systemd.automounts = let commonAutoMountOptions = { wantedBy = [ "multi-user.target" ]; automountConfig = { TimeoutIdleSec = "60"; }; }; in
[
(commonAutoMountOptions // { where = "/mnt/uwuraid/anime"; })
(commonAutoMountOptions // { where = "/mnt/uwuraid/backup"; })
(commonAutoMountOptions // { where = "/mnt/uwuraid/syncthing"; })
(commonAutoMountOptions // { where = "/mnt/uwuraid/television"; })
(commonAutoMountOptions // { where = "/mnt/uwuraid/photos"; })
(commonAutoMountOptions // { where = "/mnt/uwuraid/movies"; })
];
}