This commit is contained in:
Daniel Flanagan 2023-10-03 16:26:45 -05:00
parent 3e77b71198
commit cb36345d96
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
13 changed files with 341 additions and 233 deletions

View file

@ -19,6 +19,22 @@
"url": "ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git" "url": "ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git"
} }
}, },
"base16-schemes": {
"flake": false,
"locked": {
"lastModified": 1689473676,
"narHash": "sha256-L0RhUr9+W5EPWBpLcmkKpUeCEWRs/kLzVMF3Vao2ZU0=",
"owner": "tinted-theming",
"repo": "base16-schemes",
"rev": "d95123ca6377cd849cfdce92c0a24406b0c6a789",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-schemes",
"type": "github"
}
},
"crane": { "crane": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -176,6 +192,72 @@
"type": "github" "type": "github"
} }
}, },
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": "nixpkgs_5",
"systems": "systems_3",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1696261738,
"narHash": "sha256-ujhtnd7vCZHJosOxTi4lgIyHA6iblYwXhx+ZS678fxw=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "b784931e678f907b1f1e41d04485fefd8a1faaf8",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"nix-colors": {
"inputs": {
"base16-schemes": "base16-schemes",
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1695388192,
"narHash": "sha256-2jelpE7xK+4M7jZNyWL7QYOYegQLYBDQS5bvdo8XRUQ=",
"owner": "misterio77",
"repo": "nix-colors",
"rev": "37227f274b34a3b51649166deb94ce7fec2c6a4c",
"type": "github"
},
"original": {
"owner": "misterio77",
"repo": "nix-colors",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1690026219, "lastModified": 1690026219,
@ -192,6 +274,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1694911725,
"narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "819180647f428a3826bfc917a54449da1e532ce0",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1696039360, "lastModified": 1696039360,
@ -289,6 +386,22 @@
} }
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": {
"lastModified": 1694767346,
"narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ace5093e36ab1e95cb9463863491bee90d5a4183",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1694760568, "lastModified": 1694760568,
"narHash": "sha256-3G07BiXrp2YQKxdcdms22MUx6spc6A++MSePtatCYuI=", "narHash": "sha256-3G07BiXrp2YQKxdcdms22MUx6spc6A++MSePtatCYuI=",
@ -311,6 +424,8 @@
"hardware": "hardware", "hardware": "hardware",
"helix": "helix", "helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland",
"nix-colors": "nix-colors",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
@ -343,7 +458,7 @@
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_6",
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
@ -389,6 +504,69 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_3": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1696255886,
"narHash": "sha256-0KZfiqqREousitBgG1mkzKmmNX4tjOIWdbBm6MvRCjQ=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "5ef42e8e8adece098848fac53c721b6eb3818fc2",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"rev": "5ef42e8e8adece098848fac53c721b6eb3818fc2",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1694628480,
"narHash": "sha256-Qg9hstRw0pvjGu5hStkr2UX1D73RYcQ9Ns/KnZMIm9w=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "8f45a6435069b9e24ebd3160eda736d7a391cbf2",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -16,8 +16,9 @@
hardware.url = "github:nixos/nixos-hardware"; hardware.url = "github:nixos/nixos-hardware";
# TODO: hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";
# TODO: nix-colors.url = "github:misterio77/nix-colors";
nix-colors.url = "github:misterio77/nix-colors";
}; };
outputs = { outputs = {
@ -25,6 +26,7 @@
nixpkgs-stable, nixpkgs-stable,
nixpkgs-unstable, nixpkgs-unstable,
home-manager, home-manager,
nix-colors,
... ...
} @ inputs: let } @ inputs: let
inherit (self) outputs; inherit (self) outputs;
@ -61,27 +63,44 @@
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = let nixosConfigurations = let
# mkNixosSystem = system: modules: mkNixosSystem = cb: system: modules:
# nixpkgs-stable.lib.nixosSystem { cb {
# system = system;
# specialArgs = {
# inherit inputs outputs system;
# flake = self;
# };
# modules = [self.nixosModules.common] ++ modules;
# };
mkNixosUnstableSystem = system: modules:
nixpkgs-unstable.lib.nixosSystem {
system = system; system = system;
specialArgs = { specialArgs = {
inherit inputs outputs system; inherit inputs outputs system nix-colors;
flake = self; flake = self;
}; };
modules = [ self.nixosModules.common ] ++ modules; modules =
[
inputs.sops-nix.nixosModules.sops
self.nixosModules.common
]
++ modules
++ [
# all nixos hosts should use our home manager config
# TODO: unify with the module list in outputs.homeConfigurations.daniel
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = {inherit inputs outputs system nix-colors;};
users.daniel = {
imports = [./home ./home/linux.nix];
};
};
}
];
}; };
mkNixosStableSystem = mkNixosSystem nixpkgs-stable.lib.nixosSystem;
mkNixosUnstableSystem = mkNixosSystem nixpkgs-unstable.lib.nixosSystem;
in { in {
dragon = mkNixosUnstableSystem "x86_64-linux" [./nixos/dragon]; dragon = mkNixosUnstableSystem "x86_64-linux" [./nixos/dragon];
thinker = mkNixosUnstableSystem "x86_64-linux" [./nixos/thinker]; thinker = mkNixosUnstableSystem "x86_64-linux" [./nixos/thinker];
beefcake = mkNixosStableSystem "x86_64-linux" [
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
./nixos/beefcake
];
rascal = mkNixosStableSystem "x86_64-linux" [./nixos/rascal];
musicbox = mkNixosUnstableSystem "x86_64-linux" [./nixos/musicbox];
}; };
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
@ -90,7 +109,7 @@
mkHome = system: modules: mkHome = system: modules:
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs-unstable.legacyPackages.${system}; pkgs = nixpkgs-unstable.legacyPackages.${system};
extraSpecialArgs = {inherit inputs outputs system;}; extraSpecialArgs = {inherit inputs outputs system nix-colors;};
modules = modules; modules = modules;
}; };
in { in {

View file

@ -3,6 +3,7 @@
lib, lib,
system, system,
inputs, inputs,
nix-colors,
... ...
}: let }: let
email = "daniel@lyte.dev"; email = "daniel@lyte.dev";
@ -18,6 +19,31 @@ in {
# TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module) # TODO: fonts? right now they are only handled at the nixos-level (desktop-usage module)
# TODO: wallpaper? # TODO: wallpaper?
imports = [
nix-colors.homeManagerModules.default
];
colorScheme = nix-colors.colorSchemes.catppuccin-mocha;
# copied here for easy lookups:
# https://github.com/tinted-theming/base16-schemes/blob/main/catppuccin-mocha.yaml
# base00: "1e1e2e" # base
# base01: "181825" # mantle
# base02: "313244" # surface0
# base03: "45475a" # surface1
# base04: "585b70" # surface2
# base05: "cdd6f4" # text
# base06: "f5e0dc" # rosewater
# base07: "b4befe" # lavender
# base08: "f38ba8" # red
# base09: "fab387" # peach
# base0A: "f9e2af" # yellow
# base0B: "a6e3a1" # green
# base0C: "94e2d5" # teal
# base0D: "89b4fa" # blue
# base0E: "cba6f7" # mauve
# base0F: "f2cdcd" # flamingo
home = { home = {
username = lib.mkDefault "daniel"; username = lib.mkDefault "daniel";
homeDirectory = lib.mkDefault "/home/daniel/.home"; homeDirectory = lib.mkDefault "/home/daniel/.home";

View file

@ -13,7 +13,21 @@
services = { services = {
mako = { mako = {
enable = true; enable = true;
borderSize = 1;
maxVisible = 5;
defaultTimeout = 15000;
font = "Symbols Nerd Font 12,IosevkaLyteTerm 12";
# TODO: config # TODO: config
backgroundColor = "#1e1e2e";
textColor = "#cdd6f4";
borderColor = "#89b4fa";
progressColor = "#313244";
extraConfig = ''
[urgency=high]
border-color=#fab387
'';
}; };
swayidle = { swayidle = {
@ -273,7 +287,44 @@
}; };
assigns = {}; assigns = {};
bars = []; bars = [];
colors = {}; colors = with config.colorScheme.colors; {
background = "#1e1e2e";
focused = {
background = base03;
border = base0C;
childBorder = base0C;
indicator = base0C;
text = base05;
};
focusedInactive = {
background = base03;
border = base0D;
childBorder = base0D;
indicator = base0D;
text = base05;
};
placeholder = {
background = base03;
border = base0D;
childBorder = base0D;
indicator = base0D;
text = base05;
};
unfocused = {
background = base03;
border = base03;
childBorder = base03;
indicator = base03;
text = base05;
};
urgent = {
background = base03;
border = base0F;
childBorder = base0F;
indicator = base0F;
text = base05;
};
};
}; };
}; };
@ -298,6 +349,10 @@
]; ];
programs = { programs = {
# TODO: hyprland = {
# enable = true;
# };
waybar = { waybar = {
enable = true; enable = true;
settings = { settings = {
@ -496,6 +551,7 @@
padding: 0 0.75em; padding: 0 0.75em;
background-color: transparent; background-color: transparent;
border-top: solid @sapphire 1px; border-top: solid @sapphire 1px;
transition: none;
} }
#workspaces button:hover { #workspaces button:hover {

View file

@ -4,10 +4,13 @@
system, system,
... ...
}: { }: {
# TODO: add a DE and include either plasma or gnome as a fallback? # TODO: add a DE?
# and include either plasma or gnome as a fallback?
imports = [ imports = [
./sway.nix ./sway.nix
./hyprland.nix
./plasma.nix
./user-installed-applications.nix ./user-installed-applications.nix
]; ];

View file

@ -0,0 +1,3 @@
{...}: {
# TODO: programs.hyprland.enable = true;
}

5
modules/nixos/plasma.nix Normal file
View file

@ -0,0 +1,5 @@
{...}: {
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
}

View file

@ -1,5 +1,6 @@
{...}: { {...}: {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
systemd.services.NetworkManager-wait-online.enable = false;
# iwd? # iwd?
# powersave? # powersave?

View file

@ -2,6 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running 'nixos-help'). # and in the NixOS manual (accessible by running 'nixos-help').
{ {
outputs,
modulesPath, modulesPath,
config, config,
pkgs, pkgs,
@ -9,7 +10,7 @@
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
../modules/intel.nix outputs.nixosModules.intel
]; ];
boot.initrd.availableKernelModules = ["ehci_pci" "megaraid_sas" "usbhid" "uas" "sd_mod"]; boot.initrd.availableKernelModules = ["ehci_pci" "megaraid_sas" "usbhid" "uas" "sd_mod"];
@ -54,7 +55,7 @@
systemd.services.api-lyte-dev.environment.LOG_LEVEL = "debug"; systemd.services.api-lyte-dev.environment.LOG_LEVEL = "debug";
sops = { sops = {
defaultSopsFile = ../secrets/beefcake/secrets.yml; defaultSopsFile = ../../secrets/beefcake/secrets.yml;
age = { age = {
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
keyFile = "/var/lib/sops-nix/key.txt"; keyFile = "/var/lib/sops-nix/key.txt";

View file

@ -1,56 +0,0 @@
inputs @ {self, ...}: let
daniel = system: {
home-manager.users.daniel = {
imports = [./home/user.nix ./home/linux.nix];
};
};
hms = system: [
inputs.home-manager.nixosModules.home-manager
(daniel system)
];
disko = args @ {scheme, ...}: [
inputs.disko.nixosModules.disko
self.diskoConfigurations.${scheme}
{_module.args = args;}
];
nixosSystem = system: modules: (inputs.nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs system;};
modules =
[
inputs.sops-nix.nixosModules.sops
./nixos/common.nix
]
++ modules
++ hms system;
});
in {
# TODO: disko-fy rascal and beefcake?
beefcake = nixosSystem "x86_64-linux" [
./nixos/beefcake.nix
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
];
rascal = nixosSystem "x86_64-linux" [./nixos/rascal.nix];
musicbox = nixosSystem "x86_64-linux" (disko
{
scheme = "unencrypted";
disks = ["/dev/sda"];
}
++ [./nixos/musicbox.nix]);
thinker = nixosSystem "x86_64-linux" (disko
{
scheme = "thinker";
disks = ["/dev/nvme0n1"];
}
++ [./nixos/thinker.nix]);
dragon = nixosSystem "x86_64-linux" (disko
{
scheme = "standard";
disks = ["/dev/nvme0n1"];
}
++ [./nixos/dragon.nix]);
}

View file

@ -1,165 +1,29 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
{ {
pkgs, flake,
inputs, inputs,
outputs,
# lib,
# config,
# pkgs,
... ...
}: let }: {
# this is unused because it's referenced by my sway config networking.hostName = "musicbox";
dbus-sway-environment = pkgs.writeTextFile {
name = "dbus-sway-environment";
destination = "/bin/dbus-sway-environment";
executable = true;
text = '' imports =
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway [
systemctl --user stop wireplumber xdg-desktop-portal xdg-desktop-portal-wlr inputs.disko.nixosModules.disko
systemctl --user start wireplumber xdg-desktop-portal xdg-desktop-portal-wlr flake.diskoConfigurations.unencrypted
''; ]
}; ++ (with outputs.nixosModules; [
# If you want to use modules your own flake exports (from modules/nixos):
desktop-usage
wifi
]);
# this is unused because it's referenced by my sway config
configure-gtk = pkgs.writeTextFile {
name = "configure-gtk";
destination = "/bin/configure-gtk";
executable = true;
text = let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in ''
export XDG_DATA_DIRS="${datadir}:$XDG_DATA_DIRS
gnome_schema = org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme 'Catppuccin-Mocha'
'';
};
in {
# TODO: fonts? right now, I'm just installing to ~/.local/share/fonts
nix.settings.experimental-features = ["nix-command" "flakes"];
boot.loader.grub.devices = ["/dev/sda"];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
};
};
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.opengl = {
enable = true;
driSupport32Bit = true;
driSupport = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
];
};
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
];
};
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
networking.hostName = "musicbox";
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
security.polkit.enable = true;
security.rtkit.enable = true;
programs.fish.enable = true;
users.defaultUserShell = pkgs.fish;
services.pipewire = {
enable = true;
wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
time.timeZone = "America/Chicago";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
};
services.xserver.layout = "us";
services.xserver.xkbOptions = "ctrl:nocaps";
hardware.pulseaudio.support32Bit = true;
users.users.daniel = {
isNormalUser = true;
home = "/home/daniel/.home";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
];
extraGroups = ["wheel" "video" "docker"];
packages = [];
};
services.dbus.enable = true;
services.pcscd.enable = true;
services.flatpak.enable = true;
services.gnome.gnome-keyring.enable = true;
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "gnome3";
enableSSHSupport = true;
};
programs.thunar.enable = true;
services.tailscale = {
enable = true;
useRoutingFeatures = "client";
};
environment.variables = {
EDITOR = "hx";
};
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
};
listenAddresses = [
{
addr = "0.0.0.0";
port = 22;
}
];
};
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [];
allowedUDPPorts = [];
};
system.stateVersion = "23.05"; system.stateVersion = "23.05";
} }

View file

@ -1,10 +1,11 @@
{ {
outputs,
config, config,
modulesPath, modulesPath,
... ...
}: { }: {
imports = [ imports = [
../modules/amd.nix outputs.nixosModules.amd
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];

View file

@ -14,13 +14,20 @@ You don't have even have to clone this crap yourself. How cool is that!
But if you're gonna change stuff you had better setup the pre-commit hook: But if you're gonna change stuff you had better setup the pre-commit hook:
```shell_session ```shell_session
ln -s $PWD/pre-commit.bash .git/hooks/pre-commit $ ln -s $PWD/pre-commit.bash .git/hooks/pre-commit
```
If you're deploying anything secrets-related, you will need the proper keys:
```shell_session
$ mkdir -p ${XDG_CONFIG_HOME:-~/.config}/sops/age
$ pass age-key >> ${XDG_CONFIG_HOME:-~/.config}/sops/age/keys.txt
``` ```
## NixOS ## NixOS
```shell_session ```shell_session
nixos-rebuild switch --flake git+https://git.lyte.dev/lytedev/nix $ nixos-rebuild switch --flake git+https://git.lyte.dev/lytedev/nix
``` ```
## Not NixOS ## Not NixOS