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.url = "github:lytedev/ssbm-nix/my-nixpkgs";
ssbm.inputs.nixpkgs.follows = "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"; # 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 = { outputs = {
@ -81,63 +76,47 @@
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = builtins.mapAttrs (name: {}: (import ./nixos) { nixosConfigurations = builtins.mapAttrs (name: {
base = { system,
system = "x86_64-linux"; modules,
modules = [./nixos/base]; ...
}; }:
nixpkgs.lib.nixosSystem {
thablet = { inherit system;
system = "x86_64-linux"; specialArgs = {
modules = [./nixos/thablet]; inherit inputs outputs system;
}; inherit (outputs) colors font;
thinker = mkNixosSystem "x86_64-linux" [ flake = self;
./nixos/thinker };
(danielWithModules [outputs.homeManagerModules.thinker]) modules =
]; [
foxtrot = mkNixosSystem "x86_64-linux" [ self.nixosModules.common
./nixos/foxtrot ]
(danielWithModules [outputs.homeManagerModules.foxtrot]) ++ modules;
]; }) (import ./nixos);
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])
];
};
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname' # Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = { homeConfigurations = {
# TODO: non-system-specific home configurations? # TODO: non-system-specific home configurations?
"base-x86_64-linux" = let # "base-x86_64-linux" = let
system = "x86_64-linux"; # system = "x86_64-linux";
in # in
home-manager.lib.homeManagerConfiguration { # home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; # pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {inherit inputs outputs system colors font;}; # extraSpecialArgs = {
modules = with outputs.homeManagerModules; [linux]; # inherit inputs outputs system;
}; # };
"base-aarch64-darwin" = let # modules = with outputs.homeManagerModules; [linux];
system = "aarch64-darwin"; # };
in # "base-aarch64-darwin" = let
home-manager.lib.homeManagerConfiguration { # system = "aarch64-darwin";
pkgs = nixpkgs.legacyPackages.${system}; # in
extraSpecialArgs = {inherit inputs outputs system colors font;}; # home-manager.lib.homeManagerConfiguration {
modules = with outputs.homeManagerModules; [macos]; # pkgs = nixpkgs.legacyPackages.${system};
}; # extraSpecialArgs = {inherit inputs outputs system colors font;};
# modules = with outputs.homeManagerModules; [macos];
# };
}; };
# Disk partition schemes and functions # Disk partition schemes and functions

View file

@ -15,26 +15,16 @@
bat bat
helix helix
git git
# iex
zellij zellij
broot broot
nnn nnn
htop htop
cargo
# senpai
tmux tmux
]; ];
# TODO: specify an email?
# accounts.email.accounts = {
# primary = {
# address = "daniel@lyte.dev";
# };
# };
home = { home = {
username = lib.mkDefault "daniel"; username = lib.mkDefault "lytedev";
homeDirectory = lib.mkDefault "/home/daniel/.home"; homeDirectory = lib.mkDefault "/home/lytedev";
stateVersion = lib.mkDefault "23.11"; stateVersion = lib.mkDefault "23.11";
sessionVariables = { sessionVariables = {
@ -45,9 +35,6 @@
}; };
packages = [ packages = [
# I use gawk for my fish prompt
pkgs.gawk
# text editor # text editor
inputs.helix.packages.${system}.helix inputs.helix.packages.${system}.helix
@ -55,6 +42,7 @@
pkgs.nil pkgs.nil
pkgs.alejandra pkgs.alejandra
# common scripts
(pkgs.buildEnv { (pkgs.buildEnv {
name = "my-scripts-common"; name = "my-scripts-common";
paths = [./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). with builtins;
# These should be stuff you would like to share with others, not your personal configurations. listToAttrs (map (name: {
{ name = name;
# List your module files here value = import ./${name}.nix;
# my-module = import ./my-module.nix; }) [
common = import ./common.nix; "common"
melee = import ./melee.nix; "melee"
linux = import ./linux.nix; "linux"
cargo = import ./cargo.nix; "cargo"
macos = import ./macos.nix; "macos"
iex = import ./iex.nix; "iex"
mako = import ./mako.nix; "mako"
git = import ./git.nix; "git"
helix = import ./helix.nix; "helix"
bat = import ./bat.nix; "bat"
fish = import ./fish.nix; "fish"
kitty = import ./kitty.nix; "kitty"
wezterm = import ./wezterm.nix; "wezterm"
zellij = import ./zellij.nix; "zellij"
firefox = import ./firefox.nix; "firefox"
broot = import ./broot.nix; "broot"
nnn = import ./nnn.nix; "nnn"
waybar = import ./waybar.nix; "waybar"
swaylock = import ./swaylock.nix; "swaylock"
desktop = import ./desktop.nix; "desktop"
linux-desktop = import ./linux-desktop.nix; "linux-desktop"
sway = import ./sway.nix; "sway"
hyprland = import ./hyprland.nix; "hyprland"
ewwbar = import ./ewwbar.nix; "ewwbar"
sway-laptop = import ./sway-laptop.nix; "sway-laptop"
tmux = import ./tmux.nix; "tmux"
htop = import ./htop.nix; "htop"
senpai = import ./senpai.nix; "senpai"
])
flanfam = import ./flanfam.nix;
flanfamkiosk = import ./flanfamkiosk.nix;
base = import ./base.nix;
dragon = import ./dragon.nix;
thinker = import ./thinker.nix;
foxtrot = import ./foxtrot.nix;
}

View file

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

View file

@ -3,9 +3,7 @@
pkgs, pkgs,
... ...
}: { }: {
imports = with outputs.homeManagerModules; [ imports = with outputs.homeManagerModules; [common];
common
];
home = { home = {
sessionVariables = { 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, lib,
inputs, inputs,
colors, colors,
# outputs, outputs,
system, system,
pkgs, pkgs,
modulesPath,
... ...
}: { }: {
networking.hostName = lib.mkDefault "nixoslyte"; networking.hostName = lib.mkDefault "nixoslyte";
imports = [ imports =
inputs.home-manager.nixosModules.home-manager [
]; (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; 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 = { programs = {
fish = { fish = {
enable = true; 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}=="2e3c", ATTRS{idProduct}=="df11", MODE="0664", GROUP="uucp"
# # ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", 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). with builtins;
# These should be stuff you would like to share with others, not your personal configurations. listToAttrs (map (name: {
{ name = name;
common = import ./common.nix; value = import ./${name}.nix;
melee = import ./melee.nix; }) [
ewwbar = import ./ewwbar.nix; "common"
desktop-usage = import ./desktop-usage.nix; "melee"
intel = import ./intel.nix; "ewwbar"
pipewire = import ./pipewire.nix; "desktop-usage"
pipewire-low-latency = import ./pipewire-low-latency.nix; "intel"
podman = import ./podman.nix; "pipewire"
postgres = import ./postgres.nix; "pipewire"
sway = import ./sway.nix; "podman"
hyprland = import ./hyprland.nix; "postgres"
user-installed-applications = import ./user-installed-applications.nix; "sway"
wifi = import ./wifi.nix; "hyprland"
gnome = import ./gnome.nix; "user-installed-applications"
kde-connect = import ./kde-connect.nix; "wifi"
"gnome"
"kde-connect"
"printing"
"avahi"
flanfam = import ./flanfam.nix; "daniel"
flanfamkiosk = import ./flanfamkiosk.nix; "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; # 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 @@
{ with builtins; (listToAttrs (map (name: {
base = { name = name;
system = "x86_64-linux"; value = {
modules = [./base]; system = "x86_64-linux";
}; modules = [./${name}.nix];
};
thablet = { }) [
system = "x86_64-linux"; "base"
modules = [./thablet]; "thablet"
}; "thinker"
"foxtrot"
thinker = { "beefcake"
system = "x86_64-linux"; "rascal"
modules = [./thinker]; "musicbox"
}; "router"
]))
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];
};
}

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; powerOnBoot = false;
}; };
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; 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 = { services.fprintd = {
enable = false; enable = false;

View file

@ -10,7 +10,6 @@
imports = imports =
[ [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard flake.diskoConfigurations.standard
inputs.hardware.nixosModules.lenovo-thinkpad-x1-yoga 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; boot.loader.systemd-boot.enable = true;
services.fprintd = { services.fprintd = {