Progress on organization

This commit is contained in:
Daniel Flanagan 2024-01-04 17:20:02 -06:00
parent 9b228e61bc
commit 000ef1fb2c
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
23 changed files with 354 additions and 424 deletions

View file

@ -27,13 +27,8 @@
ssbm.url = "github:lytedev/ssbm-nix/my-nixpkgs";
ssbm.inputs.nixpkgs.follows = "nixpkgs";
# doesn't support the forge mod loader yet
# TODO: doesn't support the forge mod loader yet
# nix-minecraft.url = "github:Infinidoge/nix-minecraft";
# need to bump ishiiruka upstream I think
# slippi-desktop.url = "github:project-slippi/slippi-desktop-app";
# slippi-desktop.flake = false;
# ssbm.inputs.slippi-desktop.follows = "slippi-desktop";
};
outputs = {
@ -81,63 +76,47 @@
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = builtins.mapAttrs (name: {}: (import ./nixos) {
base = {
system = "x86_64-linux";
modules = [./nixos/base];
};
thablet = {
system = "x86_64-linux";
modules = [./nixos/thablet];
};
thinker = mkNixosSystem "x86_64-linux" [
./nixos/thinker
(danielWithModules [outputs.homeManagerModules.thinker])
];
foxtrot = mkNixosSystem "x86_64-linux" [
./nixos/foxtrot
(danielWithModules [outputs.homeManagerModules.foxtrot])
];
beefcake = mkNixosSystem "x86_64-linux" [
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
./nixos/beefcake
(danielWithModules [outputs.homeManagerModules.linux])
];
rascal = mkNixosSystem "x86_64-linux" [
./nixos/rascal
(danielWithModules [outputs.homeManagerModules.linux])
];
musicbox = mkNixosSystem "x86_64-linux" [
./nixos/musicbox
(danielWithModules [outputs.homeManagerModules.sway])
];
router = mkNixosSystem "x86_64-linux" [
./nixos/router
(danielWithModules [outputs.homeManagerModules.common])
];
nixosConfigurations = builtins.mapAttrs (name: {
system,
modules,
...
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
flake = self;
};
modules =
[
self.nixosModules.common
]
++ modules;
}) (import ./nixos);
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# TODO: non-system-specific home configurations?
"base-x86_64-linux" = let
system = "x86_64-linux";
in
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {inherit inputs outputs system colors font;};
modules = with outputs.homeManagerModules; [linux];
};
"base-aarch64-darwin" = let
system = "aarch64-darwin";
in
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {inherit inputs outputs system colors font;};
modules = with outputs.homeManagerModules; [macos];
};
# "base-x86_64-linux" = let
# system = "x86_64-linux";
# in
# home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.${system};
# extraSpecialArgs = {
# inherit inputs outputs system;
# };
# modules = with outputs.homeManagerModules; [linux];
# };
# "base-aarch64-darwin" = let
# system = "aarch64-darwin";
# in
# home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.${system};
# extraSpecialArgs = {inherit inputs outputs system colors font;};
# modules = with outputs.homeManagerModules; [macos];
# };
};
# Disk partition schemes and functions

View file

@ -15,26 +15,16 @@
bat
helix
git
# iex
zellij
broot
nnn
htop
cargo
# senpai
tmux
];
# TODO: specify an email?
# accounts.email.accounts = {
# primary = {
# address = "daniel@lyte.dev";
# };
# };
home = {
username = lib.mkDefault "daniel";
homeDirectory = lib.mkDefault "/home/daniel/.home";
username = lib.mkDefault "lytedev";
homeDirectory = lib.mkDefault "/home/lytedev";
stateVersion = lib.mkDefault "23.11";
sessionVariables = {
@ -45,9 +35,6 @@
};
packages = [
# I use gawk for my fish prompt
pkgs.gawk
# text editor
inputs.helix.packages.${system}.helix
@ -55,6 +42,7 @@
pkgs.nil
pkgs.alejandra
# common scripts
(pkgs.buildEnv {
name = "my-scripts-common";
paths = [./scripts/common];

View file

@ -1,42 +1,34 @@
# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;
common = import ./common.nix;
melee = import ./melee.nix;
linux = import ./linux.nix;
cargo = import ./cargo.nix;
macos = import ./macos.nix;
iex = import ./iex.nix;
mako = import ./mako.nix;
git = import ./git.nix;
helix = import ./helix.nix;
bat = import ./bat.nix;
fish = import ./fish.nix;
kitty = import ./kitty.nix;
wezterm = import ./wezterm.nix;
zellij = import ./zellij.nix;
firefox = import ./firefox.nix;
broot = import ./broot.nix;
nnn = import ./nnn.nix;
waybar = import ./waybar.nix;
swaylock = import ./swaylock.nix;
desktop = import ./desktop.nix;
linux-desktop = import ./linux-desktop.nix;
sway = import ./sway.nix;
hyprland = import ./hyprland.nix;
ewwbar = import ./ewwbar.nix;
sway-laptop = import ./sway-laptop.nix;
tmux = import ./tmux.nix;
htop = import ./htop.nix;
senpai = import ./senpai.nix;
flanfam = import ./flanfam.nix;
flanfamkiosk = import ./flanfamkiosk.nix;
base = import ./base.nix;
dragon = import ./dragon.nix;
thinker = import ./thinker.nix;
foxtrot = import ./foxtrot.nix;
}
with builtins;
listToAttrs (map (name: {
name = name;
value = import ./${name}.nix;
}) [
"common"
"melee"
"linux"
"cargo"
"macos"
"iex"
"mako"
"git"
"helix"
"bat"
"fish"
"kitty"
"wezterm"
"zellij"
"firefox"
"broot"
"nnn"
"waybar"
"swaylock"
"desktop"
"linux-desktop"
"sway"
"hyprland"
"ewwbar"
"sway-laptop"
"tmux"
"htop"
"senpai"
])

View file

@ -1,4 +1,10 @@
{
{pkgs, ...}: {
home = {
packages = [
pkgs.gawk # used in prompt
];
};
programs.fish = {
enable = true;
# I load long scripts from files for a better editing experience

View file

@ -3,9 +3,7 @@
pkgs,
...
}: {
imports = with outputs.homeManagerModules; [
common
];
imports = with outputs.homeManagerModules; [common];
home = {
sessionVariables = {

9
modules/nixos/avahi.nix Normal file
View file

@ -0,0 +1,9 @@
{
# enable mDNS and discovery
services.avahi = {
enable = true;
reflector = true;
openFirewall = true;
nssmdns = true;
};
}

View file

@ -3,16 +3,25 @@
lib,
inputs,
colors,
# outputs,
outputs,
system,
pkgs,
modulesPath,
...
}: {
networking.hostName = lib.mkDefault "nixoslyte";
imports = [
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
# inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko
inputs.home-manager.nixosModules.home-manager
];
]
++ (with outputs.nixosModules; [
avahi
# daniel
]);
hardware.enableRedistributableFirmware = true;
@ -177,44 +186,6 @@
'';
};
nix = {
settings = {
trusted-users = ["root" "daniel"];
experimental-features = lib.mkDefault ["nix-command" "flakes"];
substituters = [
"https://cache.nixos.org/"
"https://helix.cachix.org"
"https://nix-community.cachix.org"
"https://nix.h.lyte.dev"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
];
};
registry = {
self.flake = inputs.self;
nixpkgs = {
from = {
id = "nixpkgs";
type = "indirect";
};
flake = inputs.nixpkgs;
};
};
};
nixpkgs = {
config = {
allowUnfree = true;
};
hostPlatform = lib.mkDefault "x86_64-linux";
};
programs = {
fish = {
enable = true;
@ -254,4 +225,71 @@
# # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"
# # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"'
# '';
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
trusted-users = ["root" "daniel"];
experimental-features = lib.mkDefault ["nix-command" "flakes"];
substituters = [
"https://cache.nixos.org/"
"https://helix.cachix.org"
"https://nix-community.cachix.org"
"https://nix.h.lyte.dev"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
];
auto-optimise-store = true;
};
# registry = {
# self.flake = inputs.self;
# nixpkgs = {
# from = {
# id = "nixpkgs";
# type = "indirect";
# };
# flake = inputs.nixpkgs;
# };
# };
};
system.stateVersion = lib.mkDefault "23.11";
}

35
modules/nixos/daniel.nix Normal file
View file

@ -0,0 +1,35 @@
{outputs, ...}: {
home-manager = {
users.daniel = {
# TODO: specify an email?
accounts.email.accounts = {
primary = {
address = "daniel@lyte.dev";
};
legacy = {
address = "wraithx2@gmail.com";
};
io = {
# TODO: finalize deprecation
address = "daniel@lytedev.io";
};
# TODO: may need to use a sops secret? put in another module?
# work = {
# address = "REDACTED";
# };
};
home = {
username = "daniel";
homeDirectory = "/home/daniel/.home";
};
imports = with outputs.homeManagerModules; [
common
senpai
iex
cargo
];
};
};
}

View file

@ -1,22 +1,27 @@
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
common = import ./common.nix;
melee = import ./melee.nix;
ewwbar = import ./ewwbar.nix;
desktop-usage = import ./desktop-usage.nix;
intel = import ./intel.nix;
pipewire = import ./pipewire.nix;
pipewire-low-latency = import ./pipewire-low-latency.nix;
podman = import ./podman.nix;
postgres = import ./postgres.nix;
sway = import ./sway.nix;
hyprland = import ./hyprland.nix;
user-installed-applications = import ./user-installed-applications.nix;
wifi = import ./wifi.nix;
gnome = import ./gnome.nix;
kde-connect = import ./kde-connect.nix;
with builtins;
listToAttrs (map (name: {
name = name;
value = import ./${name}.nix;
}) [
"common"
"melee"
"ewwbar"
"desktop-usage"
"intel"
"pipewire"
"pipewire"
"podman"
"postgres"
"sway"
"hyprland"
"user-installed-applications"
"wifi"
"gnome"
"kde-connect"
"printing"
"avahi"
flanfam = import ./flanfam.nix;
flanfamkiosk = import ./flanfamkiosk.nix;
}
"daniel"
"flanfam"
"flanfamkiosk"
])

View file

@ -0,0 +1,13 @@
{pkgs, ...}: {
services.printing.enable = true;
services.printing.browsing = true;
services.printing.browsedConf = ''
BrowseDNSSDSubTypes _cups,_print
BrowseLocalProtocols all
BrowseRemoteProtocols all
CreateIPPPrinterQueues All
BrowseProtocols all
'';
services.printing.drivers = [pkgs.gutenprint];
}

View file

@ -1,5 +1,9 @@
{pkgs, ...}: {
imports = [./pipewire.nix];
{
pkgs,
outputs,
...
}: {
imports = with outputs.nixosModules; [pipewire];
# services.xserver.libinput.enable = true;

14
nixos/base.nix Normal file
View file

@ -0,0 +1,14 @@
{
outputs,
flake,
...
}: {
# a minimal, familiar setup that I can bootstrap atop
imports = with outputs.nixosModules; [
flake.diskoConfigurations.standard
desktop-usage
wifi
];
boot.loader.systemd-boot.enable = true;
}

View file

@ -1,60 +0,0 @@
{
# flake,
inputs,
outputs,
lib,
config,
modulesPath,
...
}: {
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko
# flake.diskoConfigurations.standard
]
++ (
with outputs.nixosModules; [
desktop-usage
wifi
]
)
++ (with outputs.homeManagerModules; [
sway
]);
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
config = {
allowUnfree = true;
};
};
nix = {
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
experimental-features = "nix-command flakes";
auto-optimise-store = true;
};
};
# not necessarily "base", but all my machines are UEFI so...
# boot.loader.systemd-boot.enable = true;
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [22];
allowedUDPPorts = [];
};
};
system.stateVersion = "23.11";
}

View file

@ -1,41 +1,16 @@
{
base = {
with builtins; (listToAttrs (map (name: {
name = name;
value = {
system = "x86_64-linux";
modules = [./base];
modules = [./${name}.nix];
};
thablet = {
system = "x86_64-linux";
modules = [./thablet];
};
thinker = {
system = "x86_64-linux";
modules = [./thinker];
};
foxtrot = {
system = "x86_64-linux";
modules = [./foxtrot];
};
beefcake = {
system = "x86_64-linux";
modules = [./beefcake];
};
rascal = {
system = "x86_64-linux";
modules = [./rascal];
};
musicbox = {
system = "x86_64-linux";
modules = [./musicbox];
};
router = {
system = "x86_64-linux";
modules = [./router];
};
}
}) [
"base"
"thablet"
"thinker"
"foxtrot"
"beefcake"
"rascal"
"musicbox"
"router"
]))

73
nixos/dragon.nix Normal file
View file

@ -0,0 +1,73 @@
{
flake,
inputs,
outputs,
lib,
pkgs,
modulesPath,
...
}: {
networking.hostName = "dragon";
# support interacting with the windows drive
boot.supportedFilesystems = ["ntfs"];
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard
inputs.hardware.nixosModules.common-cpu-amd
inputs.hardware.nixosModules.common-pc-ssd
outputs.nixosModules.pipewire-low-latency
]
++ (with outputs.nixosModules; [
common
melee
desktop-usage
podman
postgres
wifi
hyprland
printing
ewwbar
]);
services.printing.enable = true;
# TODO: https://nixos.wiki/wiki/Remote_LUKS_Unlocking
# hardware
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"];
boot.kernelModules = ["kvm-amd"];
hardware.bluetooth.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
environment = {
systemPackages = with pkgs; [
radeontop
];
};
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [22 7777];
allowedUDPPorts = [];
};
};
services.udev.packages = [
pkgs.platformio
pkgs.openocd
];
programs.adb.enable = true;
users.users.daniel.extraGroups = ["adbusers"];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.11";
}

View file

@ -1,120 +0,0 @@
{
flake,
inputs,
outputs,
lib,
config,
pkgs,
modulesPath,
...
}: {
networking.hostName = "dragon";
boot.supportedFilesystems = ["ntfs"];
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard
inputs.hardware.nixosModules.common-cpu-amd
inputs.hardware.nixosModules.common-pc-ssd
outputs.nixosModules.pipewire-low-latency
]
++ (with outputs.nixosModules; [
melee
desktop-usage
podman
postgres
wifi
hyprland
ewwbar
])
++ [
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
];
# TODO: https://nixos.wiki/wiki/Remote_LUKS_Unlocking
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
};
# hardware
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"];
boot.kernelModules = ["kvm-amd"];
hardware.bluetooth.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
services.printing.enable = true;
environment = {
systemPackages = with pkgs; [
radeontop
];
};
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [22 7777];
allowedUDPPorts = [];
};
};
services.udev.packages = [
pkgs.platformio
pkgs.openocd
];
programs.adb.enable = true;
users.users.daniel.extraGroups = ["adbusers"];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.11";
}

View file

@ -135,23 +135,6 @@
powerOnBoot = false;
};
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
services.printing.enable = true;
services.printing.browsing = true;
services.printing.browsedConf = ''
BrowseDNSSDSubTypes _cups,_print
BrowseLocalProtocols all
BrowseRemoteProtocols all
CreateIPPPrinterQueues All
BrowseProtocols all
'';
services.printing.drivers = [pkgs.gutenprint];
services.avahi = {
enable = true;
reflector = true;
openFirewall = true;
nssmdns = true;
};
services.fprintd = {
enable = false;

View file

@ -10,7 +10,6 @@
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard
inputs.hardware.nixosModules.lenovo-thinkpad-x1-yoga
]
@ -43,7 +42,6 @@
};
};
# not necessarily "base", but all my machines are UEFI so...
boot.loader.systemd-boot.enable = true;
services.fprintd = {