organization on joe, todo gpdpocket3 (#1)
This commit is contained in:
parent
92e0a90f23
commit
aa9b15702a
12 changed files with 219 additions and 148 deletions
110
flake.nix
110
flake.nix
|
@ -23,10 +23,13 @@
|
||||||
|
|
||||||
outputs = { self, nypkgs, nixpkgs, ... } @ inputs:
|
outputs = { self, nypkgs, nixpkgs, ... } @ inputs:
|
||||||
let
|
let
|
||||||
nixosSystem = nixpkgs.lib.nixosSystem;
|
nixConfigs = [
|
||||||
mkMerge = nixpkgs.lib.mkMerge;
|
{
|
||||||
|
name = "gpdPocket3";
|
||||||
sett = {
|
opts = {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
user = {
|
user = {
|
||||||
username = "josh";
|
username = "josh";
|
||||||
git = {
|
git = {
|
||||||
|
@ -34,52 +37,83 @@
|
||||||
name = "RingOfStorms (Joshua Bell)";
|
name = "RingOfStorms (Joshua Bell)";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "joe";
|
||||||
|
opts = {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
user = {
|
||||||
|
username = "josh";
|
||||||
|
git = {
|
||||||
|
email = "ringofstorms@gmail.com";
|
||||||
|
name = "RingOfStorms (Joshua Bell)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
directories = {
|
||||||
flakeDir = ./.;
|
flakeDir = ./.;
|
||||||
publicsDir = ./publics;
|
publicsDir = ./publics;
|
||||||
secretsDir = ./secrets;
|
secretsDir = ./secrets;
|
||||||
systemsDir = ./systems;
|
systemsDir = ./systems;
|
||||||
usersDir = ./users;
|
usersDir = ./users;
|
||||||
};
|
};
|
||||||
|
|
||||||
ypkgs = nypkgs.legacyPackages.x86_64-linux;
|
|
||||||
ylib = ypkgs.lib;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = builtins.foldl'
|
||||||
gpdPocket3 = nixosSystem {
|
(acc: nixConfig:
|
||||||
system = "x86_64-linux";
|
acc // {
|
||||||
modules = [ ./systems/_common/configuration.nix ./systems/gpdPocket3/configuration.nix ];
|
"${nixConfig.name}" = nixpkgs.lib.nixosSystem
|
||||||
|
{
|
||||||
|
modules = [ ./systems/_common/configuration.nix ./systems/${nixConfig.name}/configuration.nix ];
|
||||||
specialArgs = inputs // {
|
specialArgs = inputs // {
|
||||||
inherit ylib;
|
ylib = nypkgs.legacyPackages.${nixConfig.opts.system}.lib;
|
||||||
settings = sett // {
|
settings = directories // nixConfig.settings // {
|
||||||
system = {
|
system = nixConfig.opts // {
|
||||||
# TODO remove these probably not needed anymore with per machine specified here
|
hostname = nixConfig.name;
|
||||||
hostname = "gpdPocket3";
|
|
||||||
architecture = "x86_64-linux";
|
|
||||||
timeZone = "America/Chicago"; # TODO roaming?
|
|
||||||
defaultLocale = "en_US.UTF-8";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
joe = nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [ ./systems/_common/configuration.nix ./systems/joe/configuration.nix ];
|
|
||||||
specialArgs = inputs // {
|
|
||||||
inherit ylib;
|
|
||||||
settings = sett // {
|
|
||||||
system = {
|
|
||||||
# TODO remove these probably not needed anymore with per machine specified here
|
|
||||||
hostname = "joe";
|
|
||||||
architecture = "x86_64-linux";
|
|
||||||
# TODO remove?
|
|
||||||
timeZone = "America/Chicago";
|
|
||||||
defaultLocale = "en_US.UTF-8";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
} // nixConfig.opts;
|
||||||
|
})
|
||||||
|
{ }
|
||||||
|
nixConfigs;
|
||||||
|
|
||||||
|
# nixosConfigurations = {
|
||||||
|
# gpdPocket3 = nixosSystem {
|
||||||
|
# system = "x86_64-linux";
|
||||||
|
# modules = [ ./systems/_common/configuration.nix ./systems/gpdPocket3/configuration.nix ];
|
||||||
|
# specialArgs = inputs // {
|
||||||
|
# inherit ylib;
|
||||||
|
# settings = directories // {
|
||||||
|
# system = {
|
||||||
|
# # TODO remove these probably not needed anymore with per machine specified here
|
||||||
|
# hostname = "gpdPocket3";
|
||||||
|
# architecture = "x86_64-linux";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# joe = nixosSystem {
|
||||||
|
# system = "x86_64-linux";
|
||||||
|
# modules = [ ./systems/_common/configuration.nix ./systems/joe/configuration.nix ];
|
||||||
|
# specialArgs = inputs // {
|
||||||
|
# inherit ylib;
|
||||||
|
# settings = directories // {
|
||||||
|
# system = {
|
||||||
|
# # TODO remove these probably not needed anymore with per machine specified here
|
||||||
|
# hostname = "joe";
|
||||||
|
# architecture = "x86_64-linux";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
# homeConfigurations = { };
|
# homeConfigurations = { };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
10
systems/_common/components/caps_to_escape_in_tty.nix
Normal file
10
systems/_common/components/caps_to_escape_in_tty.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
# I want this globally even for root so doing it outside of home manager
|
||||||
|
services.xserver.xkbOptions = "caps:escape";
|
||||||
|
console = {
|
||||||
|
earlySetup = true;
|
||||||
|
packages = with pkgs; [ terminus_font ];
|
||||||
|
useXkbConfig = true; # use xkb.options in tty. (caps -> escape)
|
||||||
|
};
|
||||||
|
}
|
7
systems/_common/components/font_jetbrainsmono.nix
Normal file
7
systems/_common/components/font_jetbrainsmono.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
18
systems/_common/components/gnome_wayland.nix
Normal file
18
systems/_common/components/gnome_wayland.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.xserver.enable = true;
|
||||||
|
services.xserver.displayManager.gdm = {
|
||||||
|
enable = true;
|
||||||
|
autoSuspend = false;
|
||||||
|
wayland = true;
|
||||||
|
};
|
||||||
|
services.xserver.desktopManager.gnome.enable = true;
|
||||||
|
services.gnome.core-utilities.enable = false;
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
gnome.dconf-editor
|
||||||
|
gnomeExtensions.workspace-switch-wraparound
|
||||||
|
# wayland clipboard in terminal
|
||||||
|
wl-clipboard
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
22
systems/_common/components/home_manager.nix
Normal file
22
systems/_common/components/home_manager.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, pkgs, settings, ylib, ... } @ inputs:
|
||||||
|
let
|
||||||
|
home-manager = builtins.fetchTarball {
|
||||||
|
url = "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz";
|
||||||
|
# to get hash run `nix-prefetch-url --unpack "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz"`
|
||||||
|
sha256 = "0g51f2hz13dk953i501fmc6935difhz60741nypaqwz127hy5ldk";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
# home manager import
|
||||||
|
(import "${home-manager}/nixos")
|
||||||
|
];
|
||||||
|
# Home manager options
|
||||||
|
security.polkit.enable = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.extraSpecialArgs = { inherit settings; inherit ylib; inherit (inputs) ragenix; inherit (config) age; };
|
||||||
|
}
|
||||||
|
|
||||||
|
|
10
systems/_common/components/ssh.nix
Normal file
10
systems/_common/components/ssh.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
services.openssh.enable = true;
|
||||||
|
services.openssh.settings.PermitRootLogin = "yes";
|
||||||
|
# Open ports in the firewall.
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
22 # sshd
|
||||||
|
];
|
||||||
|
}
|
15
systems/_common/components/systemd_boot.nix
Normal file
15
systems/_common/components/systemd_boot.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader = {
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
consoleMode = "keep";
|
||||||
|
};
|
||||||
|
timeout = 5;
|
||||||
|
efi = {
|
||||||
|
canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
13
systems/_common/components/todo_neovim.nix
Normal file
13
systems/_common/components/todo_neovim.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# extras, more for my neovim setup TODO move these into a more isolated place for nvim setup? Should be its own flake probably
|
||||||
|
cargo
|
||||||
|
rustc
|
||||||
|
nodejs_21
|
||||||
|
python313
|
||||||
|
nodePackages.cspell
|
||||||
|
# ripgrep (now in common but will be needed in neovim flake)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
|
@ -1,48 +1,40 @@
|
||||||
{ config, lib, pkgs, settings, ylib, ... } @ inputs:
|
{ config, lib, pkgs, settings, ylib, ... } @ inputs:
|
||||||
let
|
let
|
||||||
home-manager = builtins.fetchTarball {
|
defaultLocal = "en_US.UTF-8";
|
||||||
url = "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz";
|
|
||||||
# to get hash run `nix-prefetch-url --unpack "https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz"`
|
|
||||||
sha256 = "0g51f2hz13dk953i501fmc6935difhz60741nypaqwz127hy5ldk";
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
|
# Secrets management
|
||||||
|
./ragenix.nix
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
(/${settings.systemsDir}/${settings.system.hostname}/hardware-configuration.nix)
|
(/${settings.systemsDir}/${settings.system.hostname}/hardware-configuration.nix)
|
||||||
# home manager import
|
# Include the specific machine's config.
|
||||||
(import "${home-manager}/nixos")
|
(/${settings.systemsDir}/${settings.system.hostname}/configuration.nix)
|
||||||
./ragenix.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable flakes
|
# Enable flakes
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
# Home manager options
|
|
||||||
security.polkit.enable = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.extraSpecialArgs = { inherit settings; inherit ylib; inherit (inputs) ragenix; inherit (config) age; };
|
|
||||||
|
|
||||||
# ==========
|
# ==========
|
||||||
# Common
|
# Common
|
||||||
# ==========
|
# ==========
|
||||||
networking.hostName = settings.system.hostname;
|
networking.hostName = settings.system.hostname;
|
||||||
time.timeZone = settings.system.timeZone;
|
# TODO do I want this dynamic at all? Roaming?
|
||||||
|
time.timeZone = "America/Chicago";
|
||||||
|
|
||||||
# Select internationalisation properties.
|
# Select internationalization properties.
|
||||||
i18n.defaultLocale = settings.system.defaultLocale;
|
i18n.defaultLocale = defaultLocal;
|
||||||
i18n.extraLocaleSettings = {
|
i18n.extraLocaleSettings = {
|
||||||
LC_ADDRESS = settings.system.defaultLocale;
|
LC_ADDRESS = defaultLocal;
|
||||||
LC_IDENTIFICATION = settings.system.defaultLocale;
|
LC_IDENTIFICATION = defaultLocal;
|
||||||
LC_MEASUREMENT = settings.system.defaultLocale;
|
LC_MEASUREMENT = defaultLocal;
|
||||||
LC_MONETARY = settings.system.defaultLocale;
|
LC_MONETARY = defaultLocal;
|
||||||
LC_NAME = settings.system.defaultLocale;
|
LC_NAME = defaultLocal;
|
||||||
LC_NUMERIC = settings.system.defaultLocale;
|
LC_NUMERIC = defaultLocal;
|
||||||
LC_PAPER = settings.system.defaultLocale;
|
LC_PAPER = defaultLocal;
|
||||||
LC_TELEPHONE = settings.system.defaultLocale;
|
LC_TELEPHONE = defaultLocal;
|
||||||
LC_TIME = settings.system.defaultLocale;
|
LC_TIME = defaultLocal;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Some basics
|
# Some basics
|
||||||
|
|
|
@ -5,7 +5,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ragenix.nixosModules.age ];
|
imports = [ ragenix.nixosModules.age ];
|
||||||
environment.systemPackages = [ ragenix.packages.${settings.system.architecture}.default ];
|
environment.systemPackages = [ ragenix.packages.${settings.system.system}.default ];
|
||||||
|
|
||||||
age = {
|
age = {
|
||||||
secrets =
|
secrets =
|
||||||
|
|
|
@ -2,86 +2,36 @@
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
|
# TODO revisit
|
||||||
|
(settings.systemsDir + "/_common/components/todo_neovim.nix")
|
||||||
|
# Common components this machine uses
|
||||||
|
(settings.systemsDir + "/_common/components/systemd_boot.nix")
|
||||||
|
(settings.systemsDir + "/_common/components/ssh.nix")
|
||||||
|
(settings.systemsDir + "/_common/components/caps_to_escape_in_tty.nix")
|
||||||
|
(settings.systemsDir + "/_common/components/font_jetbrainsmono.nix")
|
||||||
|
(settings.systemsDir + "/_common/components/home_manager.nix")
|
||||||
|
(settings.systemsDir + "/_common/components/gnome_wayland.nix")
|
||||||
|
# Users this machine has
|
||||||
(settings.usersDir + "/root/configuration.nix")
|
(settings.usersDir + "/root/configuration.nix")
|
||||||
(settings.usersDir + "/josh/configuration.nix")
|
(settings.usersDir + "/josh/configuration.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Machine specific configuration
|
||||||
boot.loader = {
|
hardware.enableAllFirmware = true;
|
||||||
systemd-boot = {
|
# Connectivity
|
||||||
enable = true;
|
|
||||||
consoleMode = "keep";
|
|
||||||
};
|
|
||||||
timeout = 5;
|
|
||||||
efi = {
|
|
||||||
canTouchEfiVariables = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# We want connectivity
|
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
|
environment.shellAliases = {
|
||||||
|
wifi = "nmtui";
|
||||||
|
};
|
||||||
# Enable sound.
|
# Enable sound.
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
hardware.pulseaudio.enable = true;
|
hardware.pulseaudio.enable = true;
|
||||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
||||||
|
|
||||||
hardware.enableAllFirmware = true;
|
# environment.systemPackages = with pkgs; [ ];
|
||||||
|
|
||||||
# I want this globally even for root so doing it outside of home manager
|
# nvidia gfx https://nixos.wiki/wiki/Nvidia
|
||||||
services.xserver.xkbOptions = "caps:escape";
|
|
||||||
console = {
|
|
||||||
earlySetup = true;
|
|
||||||
packages = with pkgs; [ terminus_font ];
|
|
||||||
# We want to be able to read the screen so use a 32 sized font...
|
|
||||||
# font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
|
|
||||||
useXkbConfig = true; # use xkb.options in tty. (caps -> escape)
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
|
||||||
services.openssh.enable = true;
|
|
||||||
services.openssh.settings.PermitRootLogin = "yes";
|
|
||||||
|
|
||||||
# Open ports in the firewall.
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
22 # sshd
|
|
||||||
];
|
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
||||||
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
|
||||||
];
|
|
||||||
|
|
||||||
services.xserver.enable = true;
|
|
||||||
services.xserver.displayManager.gdm = {
|
|
||||||
enable = true;
|
|
||||||
autoSuspend = false;
|
|
||||||
wayland = true;
|
|
||||||
};
|
|
||||||
services.xserver.desktopManager.gnome.enable = true;
|
|
||||||
services.gnome.core-utilities.enable = false;
|
|
||||||
|
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
# extras, more for my neovim setup TODO move these into a more isolated place for nvim setup? Should be its own flake probably
|
|
||||||
cargo
|
|
||||||
rustc
|
|
||||||
nodejs_21
|
|
||||||
python313
|
|
||||||
# ripgrep # now in common
|
|
||||||
nodePackages.cspell
|
|
||||||
];
|
|
||||||
|
|
||||||
# does for all shells. Can use `programs.zsh.shellAliases` for specific ones
|
|
||||||
environment.shellAliases = {
|
|
||||||
wifi = "nmtui";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# nvidia gfx
|
|
||||||
# =========
|
# =========
|
||||||
# Enable OpenGL
|
# Enable OpenGL
|
||||||
hardware.opengl = {
|
hardware.opengl = {
|
||||||
|
@ -93,7 +43,6 @@
|
||||||
# Load nvidia driver for Xorg and Wayland
|
# Load nvidia driver for Xorg and Wayland
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
|
|
||||||
# Modesetting is required.
|
# Modesetting is required.
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
# use `dconf dump /` before and after and diff the files for easy editing of dconf below
|
# use `dconf dump /` before and after and diff the files for easy editing of dconf below
|
||||||
# > `dconf dump / > /tmp/dconf_dump_start && watch -n0.5 'dconf dump / > /tmp/dconf_dump_current && diff --color /tmp/dconf_dump_start /tmp/dconf_dump_current -U12'`
|
# > `dconf dump / > /tmp/dconf_dump_start && watch -n0.5 'dconf dump / > /tmp/dconf_dump_current && diff --color /tmp/dconf_dump_start /tmp/dconf_dump_current -U12'`
|
||||||
# OR (Must be logged into user directly, no SU to user will work): `dconf watch /`
|
# OR (Must be logged into user directly, no SU to user will work): `dconf watch /`
|
||||||
gnome.dconf-editor
|
# gnome.dconf-editor
|
||||||
gnomeExtensions.workspace-switch-wraparound
|
# gnomeExtensions.workspace-switch-wraparound
|
||||||
#gnomeExtensions.forge # probably don't need on this on tiny laptop but may explore this instead of sway for my desktop
|
#gnomeExtensions.forge # probably don't need on this on tiny laptop but may explore this instead of sway for my desktop
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
||||||
favorite-apps = [
|
favorite-apps = [
|
||||||
# "vivaldi-stable.desktop"
|
# "vivaldi-stable.desktop"
|
||||||
"Alacritty.desktop"
|
"Alacritty.desktop"
|
||||||
|
# Wezterm is not playing nice with me on gnome wayland :(
|
||||||
# "org.wezfurlong.wezterm.desktop"
|
# "org.wezfurlong.wezterm.desktop"
|
||||||
"firefox.desktop"
|
"firefox.desktop"
|
||||||
"org.gnome.Nautilus.desktop"
|
"org.gnome.Nautilus.desktop"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue