Got NixOS file structure working (for the most part)
This commit is contained in:
parent
bb1d899da2
commit
93ae0922eb
6 changed files with 247 additions and 16 deletions
0
.config/.gsd-keyboard.settings-ported
Normal file
0
.config/.gsd-keyboard.settings-ported
Normal file
38
.config/nixos/flake.nix
Executable file
38
.config/nixos/flake.nix
Executable file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
description = "System flake";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
stylix.url = "github:danth/stylix";
|
||||||
|
stylix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
outputs = { self, nixpkgs, ... }@inputs: {
|
||||||
|
nixosConfigurations = {
|
||||||
|
mecca = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
|
modules = [
|
||||||
|
./laptop/mecca/configuration.nix
|
||||||
|
inputs.stylix.nixosModules.stylix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
syntheticnexus = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
|
modules = [
|
||||||
|
./laptop/syntheticnexus/configuration.nix
|
||||||
|
inputs.stylix.nixosModules.stylix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/*nixpkgs.lib.nixosSystem {
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
inputs.stylix.nixosModules.stylix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
description = "System flake";
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
stylix.url = "github:danth/stylix";
|
|
||||||
};
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs: {
|
|
||||||
nixosConfigurations.mecca = nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {inherit inputs;};
|
|
||||||
modules = [
|
|
||||||
./configuration.nix
|
|
||||||
inputs.stylix.nixosModules.stylix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
BIN
.config/nixos/laptop/syntheticnexus/bg.jpg
Normal file
BIN
.config/nixos/laptop/syntheticnexus/bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
167
.config/nixos/laptop/syntheticnexus/configuration.nix
Normal file
167
.config/nixos/laptop/syntheticnexus/configuration.nix
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
{ config, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enable automatic system updates
|
||||||
|
system.autoUpgrade = {
|
||||||
|
enable = true;
|
||||||
|
flake = inputs.self.outPath;
|
||||||
|
flags = [
|
||||||
|
"--update-input"
|
||||||
|
"nixpkgs"
|
||||||
|
"-L" # print build logs
|
||||||
|
];
|
||||||
|
dates = "weekly";
|
||||||
|
randomizedDelaySec = "45min";
|
||||||
|
};
|
||||||
|
# Allow non-free software (RMS will be mad at me :<)
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
# Enable nix-command and flakes
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes"];
|
||||||
|
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
systemd.tpm2.enable = false;
|
||||||
|
|
||||||
|
networking.hostName = "syntheticnexus";
|
||||||
|
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
time.timeZone = "America/St_Thomas";
|
||||||
|
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = "us";
|
||||||
|
variant = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
stylix = {
|
||||||
|
enable = true;
|
||||||
|
image = ./bg.jpg;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Using ly as TUI display manager, with minimal Gnome configuration
|
||||||
|
services.displayManager.ly.enable = true;
|
||||||
|
services.desktopManager.gnome.enable = true;
|
||||||
|
services.gnome.core-apps.enable = false;
|
||||||
|
services.gnome.core-developer-tools.enable = false;
|
||||||
|
services.gnome.games.enable = false;
|
||||||
|
environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ];
|
||||||
|
|
||||||
|
# using piprewire cuz embrace muh modernity
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.libinput.enable = true; # for laptop touchpad
|
||||||
|
|
||||||
|
# Laptop battery optimizations
|
||||||
|
# NOTE: Comment out if on PC/Not required for your rig
|
||||||
|
/* services.tlp = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||||
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||||
|
|
||||||
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||||
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||||
|
|
||||||
|
CPU_MIN_PERF_ON_AC = 0;
|
||||||
|
CPU_MAX_PERF_ON_AC = 100;
|
||||||
|
CPU_MIN_PERF_ON_BAT = 0;
|
||||||
|
CPU_MAX_PERF_ON_BAT = 20;
|
||||||
|
|
||||||
|
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
|
||||||
|
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.auto-cpufreq.enable = true;
|
||||||
|
services.auto-cpufreq.settings = {
|
||||||
|
battery = {
|
||||||
|
governor = "powersave";
|
||||||
|
turbo = "never";
|
||||||
|
};
|
||||||
|
charger = {
|
||||||
|
governor = "performance";
|
||||||
|
turbo = "auto";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
powerManagement.powertop.enable = true; */
|
||||||
|
|
||||||
|
/* # Kanata setup
|
||||||
|
# Mostly copied from https://dev.to/shanu-kumawat/how-to-set-up-kanata-on-nixos-a-step-by-step-guide-1jkc
|
||||||
|
boot.kernelModules = [ "uinput" ]; # Enable uinput kernel module
|
||||||
|
hardware.uinput.enable = true; # Enable uinput
|
||||||
|
# Set up udev rules for uinput
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
|
||||||
|
'';
|
||||||
|
users.groups.uinput = { }; # ensure uinput group exists
|
||||||
|
# Add Kanata service user to necessary groups
|
||||||
|
systemd.services.kanata-internalKeyboard.serviceConfig = {
|
||||||
|
SupplementaryGroups = [
|
||||||
|
"input"
|
||||||
|
"uinput"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
# Kanata configuration
|
||||||
|
services.kanata = {
|
||||||
|
enable = true;
|
||||||
|
keyboards = {
|
||||||
|
internalKeyboard = {
|
||||||
|
devices = [
|
||||||
|
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
||||||
|
];
|
||||||
|
extraDefCfg = "concurrent-tap-hold yes";
|
||||||
|
config = builtins.readFile(builtins.fetchurl {
|
||||||
|
url = https://git.luluslly.xyz/lulusilly/dotfiles/raw/branch/master/.config/kanata/conf.kbd;
|
||||||
|
sha256 = "";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}; */
|
||||||
|
|
||||||
|
users.users.lunita = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Lunita";
|
||||||
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
packages = with pkgs; [];
|
||||||
|
# shell = pkgs.zsh;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
curl
|
||||||
|
wget
|
||||||
|
neovim
|
||||||
|
git
|
||||||
|
gnome-console
|
||||||
|
gnomeExtensions.blur-my-shell
|
||||||
|
gnomeExtensions.just-perfection
|
||||||
|
gnomeExtensions.paperwm
|
||||||
|
nyxt
|
||||||
|
];
|
||||||
|
|
||||||
|
# Zsh
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
# Browser
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
# Tailscale
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
# Syncthing
|
||||||
|
services.syncthing.enable = true;
|
||||||
|
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
system.stateVersion = "25.05";
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
# 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" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/c7f03532-bbad-4c5d-9309-052c7cb7f63c";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/2A5E-652D";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/fcd83e93-64eb-40be-97ae-3e512bd8f97e"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
# 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.enp4s0.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp0s20f0u5.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue