Merge remote-tracking branch 'origin/main' into reduce-common

This commit is contained in:
Daniel Flanagan 2024-01-06 09:53:24 -06:00
commit c3bf12b896
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
44 changed files with 911 additions and 600 deletions

View file

@ -50,11 +50,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1699781810, "lastModified": 1704318910,
"narHash": "sha256-LD+PIUbm1yQmQmGIbSsc/PB1dtJtGqXFgxRc1C7LlfQ=", "narHash": "sha256-wOIJwAsnZhM0NlFRwYJRgO4Lldh8j9viyzwQXtrbNtM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "2d7d77878c5d70f66f3d676ff66708d8d4f9d7df", "rev": "aef9a509db64a081186af2dc185654d78dc8e344",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -120,11 +120,11 @@
}, },
"hardware": { "hardware": {
"locked": { "locked": {
"lastModified": 1702453208, "lastModified": 1704458188,
"narHash": "sha256-0wRi9SposfE2wHqjuKt8WO2izKB/ASDOV91URunIqgo=", "narHash": "sha256-f6BYEuIqnbrs6J/9m1/1VdkJ6d63hO9kUC09kTPuOqE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "7763c6fd1f299cb9361ff2abf755ed9619ef01d6", "rev": "172385318068519900a7d71c1024242fa6af75f0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -143,11 +143,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1701678371, "lastModified": 1704401390,
"narHash": "sha256-0pVtmLgjWNiR2fFqUf/5nh9r2VDTJT49ktKCJrd7mo4=", "narHash": "sha256-01Tkq958K2O7H451x8JMEDSGh344iwvhkcYsGVii+8k=",
"owner": "helix-editor", "owner": "helix-editor",
"repo": "helix", "repo": "helix",
"rev": "fcd564fddfa9b8f3fd7d02686e1f8b8a97a9f92b", "rev": "7e389b67c24dfe4466112c988b240c807e7e2414",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -164,11 +164,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1701676655, "lastModified": 1704383912,
"narHash": "sha256-wP8i7hO2aLNJhYoTK3kqoymaCLgt4QcwWcO8d/A1CjQ=", "narHash": "sha256-Be7O73qoOj/z+4ZCgizdLlu+5BkVvO2KO299goZ9cW8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "948703f3e71f1332a0cb535ebaf5cb14946e3724", "rev": "26b8adb300e50efceb51fff6859a1a6ba1ade4f7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -189,11 +189,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1700592218, "lastModified": 1704455149,
"narHash": "sha256-vHzDbBrZ5EsfVUMLgjuugf6OqB+iOLjKLO9O5n2occ4=", "narHash": "sha256-9CDCJx9ls1qQ1/uOSUzXgw0smiaEfXz/wnB40r7dYKk=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "472926528428cd714c90f157e639fc0466611c8b", "rev": "d8dbdc4a017e051b3dde2e93791e2495722bfa21",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -227,6 +227,24 @@
"type": "github" "type": "github"
} }
}, },
"hyprlang": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1704287638,
"narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"lexical": { "lexical": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
@ -251,11 +269,27 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1701718080, "lastModified": 1702645756,
"narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1704194953,
"narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -273,7 +307,7 @@
"helix": "helix", "helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"ssbm": "ssbm" "ssbm": "ssbm"
} }
@ -329,11 +363,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1700362823, "lastModified": 1703991717,
"narHash": "sha256-/H7XgvrYM0IbkpWkcdfkOH0XyBM5ewSWT1UtaLvOgKY=", "narHash": "sha256-XfBg2dmDJXPQEB8EdNBnzybvnhswaiAkUeeDj7fa/hQ=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "49a87c6c827ccd21c225531e30745a9a6464775c", "rev": "cfdbaf68d00bc2f9e071f17ae77be4b27ff72fa6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -350,11 +384,11 @@
"slippi-desktop": "slippi-desktop" "slippi-desktop": "slippi-desktop"
}, },
"locked": { "locked": {
"lastModified": 1698158961, "lastModified": 1698159739,
"narHash": "sha256-A5YMOQEckHL85Ja23YKh7mVf5M5conwIsP9HNilUuFs=", "narHash": "sha256-2oCLXsVQrrkIpp6QSq2uljJHVDkR7TJKTZLn/8uFQHU=",
"owner": "lytedev", "owner": "lytedev",
"repo": "ssbm-nix", "repo": "ssbm-nix",
"rev": "c363e7f901838ed10e8236ec908d321fb25e59d3", "rev": "764ed659a34df9696fa8bf413ae66a7f4ae3d9fb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -428,18 +462,18 @@
"flake": false, "flake": false,
"locked": { "locked": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"lastModified": 1699292815, "lastModified": 1703963193,
"narHash": "sha256-HXu98PyBMKEWLqiTb8viuLDznud/SdkdJsx5A5CWx7I=", "narHash": "sha256-ke8drv6PTrdQDruWbajrRJffP9A9PU6FRyjJGNZRTs4=",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1", "rev": "f81c3d93cd6f61b20ae784297679283438def8df",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1", "rev": "f81c3d93cd6f61b20ae784297679283438def8df",
"type": "gitlab" "type": "gitlab"
} }
}, },
@ -449,6 +483,7 @@
"hyprland", "hyprland",
"hyprland-protocols" "hyprland-protocols"
], ],
"hyprlang": "hyprlang",
"nixpkgs": [ "nixpkgs": [
"hyprland", "hyprland",
"nixpkgs" "nixpkgs"
@ -459,11 +494,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697981233, "lastModified": 1704400467,
"narHash": "sha256-y8q4XUwx+gVK7i2eLjfR32lVo7TYvEslyzrmzYEaPZU=", "narHash": "sha256-IsEAKBCorRlN53FwFAMbyGLRsPVu/ZrWEJtCwykPds8=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "22e7a65ff9633e1dedfa5317fdffc49f68de2ff2", "rev": "1c802128f6cc3db29a8ef01552b1a22f894eeefd",
"type": "github" "type": "github"
}, },
"original": { "original": {

118
flake.nix
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 = {
@ -46,24 +41,19 @@
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
# "i686-linux"
"x86_64-linux"
"aarch64-darwin" "aarch64-darwin"
"x86_64-darwin" "x86_64-darwin"
]; ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
in {
color-schemes = (import ./lib/colors.nix inputs).schemes; colors = (import ./lib/colors.nix inputs).schemes.catppuccin-mocha-sapphire;
colors = color-schemes.catppuccin-mocha-sapphire;
# colors = (import ./lib/colors.nix inputs).color-schemes.donokai; # colors = (import ./lib/colors.nix inputs).color-schemes.donokai;
font = { font = {
name = "IosevkaLyteTerm"; name = "IosevkaLyteTerm";
size = 12; size = 12;
}; };
in {
colors = colors;
font = font;
# Your custom packages # Your custom packages
# Acessible through 'nix build', 'nix shell', etc # Acessible through 'nix build', 'nix shell', etc
@ -86,95 +76,57 @@
# NixOS configuration entrypoint # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname' # Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = let nixosConfigurations = builtins.mapAttrs (name: {
mkNixosSystem = system: modules: homeManagerModules: system,
modules,
...
}:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = system; inherit system;
specialArgs = { specialArgs = {
inherit inputs outputs system colors font; inherit inputs outputs system;
flake = self; flake = self;
}; };
modules = modules =
[ [
inputs.sops-nix.nixosModules.sops
self.nixosModules.common self.nixosModules.common
] ]
++ modules ++ modules;
++ [ }) (import ./nixos);
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = {inherit inputs outputs system colors font;};
users.daniel = {
imports = homeManagerModules;
};
};
}
];
};
base = mkNixosSystem "x86_64-linux" [./nixos/base] [outputs.homeManagerModules.base];
in {
base = base;
nixos = base; # alias
dragon = mkNixosSystem "x86_64-linux" [./nixos/dragon] (with outputs.homeManagerModules; [
dragon
]);
thinker = mkNixosSystem "x86_64-linux" [./nixos/thinker] (with outputs.homeManagerModules; [
thinker
]);
foxtrot = mkNixosSystem "x86_64-linux" [./nixos/foxtrot] (with outputs.homeManagerModules; [
foxtrot
]);
beefcake =
mkNixosSystem "x86_64-linux" [
inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
./nixos/beefcake
] (with outputs.homeManagerModules; [
linux
]);
rascal = mkNixosSystem "x86_64-linux" [./nixos/rascal] (with outputs.homeManagerModules; [
linux
]);
musicbox = mkNixosSystem "x86_64-linux" [./nixos/musicbox] (with outputs.homeManagerModules; [
sway
]);
router = mkNixosSystem "x86_64-linux" [./nixos/router] (with 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;
# };
# 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;};
# modules = with outputs.homeManagerModules; [macos];
# };
}; };
"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];
};
};
# TODO: nix-on-droid for phone terminal usage?
# TODO: nix-darwin for work?
# TODO: nixos ISO?
# Disk partition schemes and functions # Disk partition schemes and functions
diskoConfigurations = import ./disko; diskoConfigurations = import ./disko;
# Flake templates for easily setting up Nix in a project using common patterns I like # Flake templates for easily setting up Nix in a project using common patterns I like
templates = import ./templates/all.nix; templates = import ./templates/all.nix;
# TODO: nix-on-droid for phone terminal usage?
# TODO: nix-darwin for work?
# TODO: nixos ISO?
}; };
nixConfig = { nixConfig = {

View file

@ -1,5 +1,5 @@
{ {
pkgs, # pkgs,
# colors, # colors,
... ...
}: { }: {

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,16 +35,11 @@
}; };
packages = [ packages = [
# I use gawk for my fish prompt
pkgs.gawk
# text editor
inputs.helix.packages.${system}.helix
# tools I use when editing nix code # tools I use when editing nix code
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,39 +1,35 @@
# 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; "bat"
melee = import ./melee.nix; "broot"
linux = import ./linux.nix; "cargo"
cargo = import ./cargo.nix; "common"
macos = import ./macos.nix; "desktop"
iex = import ./iex.nix; "ewwbar"
mako = import ./mako.nix; "firefox"
git = import ./git.nix; "fish"
helix = import ./helix.nix; "git"
bat = import ./bat.nix; "helix"
fish = import ./fish.nix; "htop"
kitty = import ./kitty.nix; "hyprland"
wezterm = import ./wezterm.nix; "iex"
zellij = import ./zellij.nix; "kitty"
firefox = import ./firefox.nix; "linux"
broot = import ./broot.nix; "linux-desktop"
nnn = import ./nnn.nix; "macos"
waybar = import ./waybar.nix; "mako"
swaylock = import ./swaylock.nix; "melee"
desktop = import ./desktop.nix; "nnn"
linux-desktop = import ./linux-desktop.nix; "pass"
sway = import ./sway.nix; "senpai"
hyprland = import ./hyprland.nix; "sway"
ewwbar = import ./ewwbar.nix; "sway-laptop"
sway-laptop = import ./sway-laptop.nix; "swaylock"
tmux = import ./tmux.nix; "tmux"
htop = import ./htop.nix; "waybar"
senpai = import ./senpai.nix; "wezterm"
"zellij"
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

@ -0,0 +1,12 @@
{...}: {
home-manager = {
users.flanfam = {
imports = [./common.nix];
home = {
username = "flanfam";
homeDirectory = "/home/flanfam";
stateVersion = "23.11";
};
};
};
}

View file

@ -0,0 +1,12 @@
{...}: {
home-manager = {
users.flanfamkiosk = {
imports = [./common.nix];
home = {
username = "flanfamkiosk";
homeDirectory = "/home/flanfamkiosk";
stateVersion = "23.11";
};
};
};
}

View file

@ -1,33 +0,0 @@
{outputs, ...}: let
scale = 1.25;
in {
imports = with outputs.homeManagerModules; [
sway
sway-laptop
hyprland
];
home = {
stateVersion = "24.05";
};
wayland.windowManager.hyprland = {
settings = {
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
monitor = [
"eDP-1,2256x1504@60,0x0,${toString scale}"
];
};
};
wayland.windowManager.sway = {
config = {
output = {
"BOE 0x0BCA Unknown" = {
mode = "2256x1504@60Hz";
scale = toString scale;
};
};
};
};
}

View file

@ -10,52 +10,53 @@
enableFishIntegration = true; enableFishIntegration = true;
}; };
settings = with colors.withHashPrefix; { settings = with colors.withHashPrefix; {
"font_family" = font.name; font_family = font.name;
"bold_font" = "${font.name} Heavy"; bold_font = "${font.name} Heavy";
"italic_font" = "${font.name} Italic"; italic_font = "${font.name} Italic";
"bold_italic_font" = "${font.name} Heavy Italic"; bold_italic_font = "${font.name} Heavy Italic";
"font_size" = toString font.size; font_size = toString font.size;
"inactive_text_alpha" = "0.5"; inactive_text_alpha = "0.5";
"copy_on_select" = true; copy_on_select = true;
hide_window_decorations = "yes";
"scrollback_lines" = 500000; scrollback_lines = 500000;
"symbol_map" = "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono"; symbol_map = "U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono";
# use `kitty + list-fonts --psnames` to get the font's PostScript name # use `kitty + list-fonts --psnames` to get the font's PostScript name
"allow_remote_control" = true; allow_remote_control = true;
"listen_on" = "unix:/tmp/kitty"; listen_on = "unix:/tmp/kitty";
"repaint_delay" = 3; repaint_delay = 3;
"input_delay" = 3; input_delay = 3;
"sync_to_monitor" = true; sync_to_monitor = true;
"adjust_line_height" = 0; adjust_line_height = 0;
"window_padding_width" = "10.0"; window_padding_width = "10.0";
"window_margin_width" = "0.0"; window_margin_width = "0.0";
"confirm_os_window_close" = 0; confirm_os_window_close = 0;
"enabled_layouts" = "splits:split_axis=vertical,stack"; enabled_layouts = "splits:split_axis=vertical,stack";
"shell_integration" = "disabled"; shell_integration = "disabled";
"enable_audio_bell" = true; enable_audio_bell = true;
"visual_bell_duration" = "0.25"; visual_bell_duration = "0.25";
"visual_bell_color" = bg3; visual_bell_color = bg3;
"url_style" = "single"; url_style = "single";
"strip_trailing_spaces" = "smart"; strip_trailing_spaces = "smart";
# open_url_modifiers ctrl # open_url_modifiers ctrl
"tab_bar_align" = "left"; tab_bar_align = "left";
"tab_bar_style" = "separator"; tab_bar_style = "separator";
"tab_separator" = ''""''; tab_separator = ''""'';
"tab_bar_edge" = "top"; tab_bar_edge = "top";
"tab_title_template" = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "''; tab_title_template = ''"{fmt.fg.tab}{fmt.bg.tab} {activity_symbol}{title} "'';
"active_tab_font_style" = "normal"; active_tab_font_style = "normal";
## name: Catppuccin Kitty Mocha ## name: Catppuccin Kitty Mocha
## author: Catppuccin Org ## author: Catppuccin Org
@ -64,75 +65,75 @@
## blurb: Soothing pastel theme for the high-spirited! ## blurb: Soothing pastel theme for the high-spirited!
# The basic colors # The basic colors
"foreground" = text; foreground = text;
"background" = bg; background = bg;
"selection_foreground" = bg; selection_foreground = bg;
"selection_background" = text; selection_background = text;
# Cursor colors # Cursor colors
"cursor" = text; cursor = text;
"cursor_text_color" = bg; cursor_text_color = bg;
# URL underline color when hovering with mouse # URL underline color when hovering with mouse
"url_color" = primary; url_color = primary;
# Kitty window border colors # Kitty window border colors
"active_border_color" = primary; active_border_color = primary;
"inactive_border_color" = bg3; inactive_border_color = bg3;
"bell_border_color" = urgent; bell_border_color = urgent;
# OS Window titlebar colors # OS Window titlebar colors
"wayland_titlebar_color" = "system"; wayland_titlebar_color = "system";
"macos_titlebar_color" = "system"; macos_titlebar_color = "system";
# Tab bar colors # Tab bar colors
"active_tab_foreground" = bg; active_tab_foreground = bg;
"active_tab_background" = primary; active_tab_background = primary;
"inactive_tab_foreground" = fgdim; inactive_tab_foreground = fgdim;
"inactive_tab_background" = bg2; inactive_tab_background = bg2;
"tab_bar_background" = bg; tab_bar_background = bg;
# Colors for marks (marked text in the terminal) # Colors for marks (marked text in the terminal)
"mark1_foreground" = bg; mark1_foreground = bg;
"mark1_background" = blue; mark1_background = blue;
"mark2_foreground" = bg; mark2_foreground = bg;
"mark2_background" = purple; mark2_background = purple;
"mark3_foreground" = bg; mark3_foreground = bg;
"mark3_background" = blue; mark3_background = blue;
# The 16 terminal colors # The 16 terminal colors
# black # black
"color0" = colors.withHashPrefix."0"; color0 = colors.withHashPrefix."0";
"color8" = colors.withHashPrefix."8"; color8 = colors.withHashPrefix."8";
# red # red
"color1" = colors.withHashPrefix."1"; color1 = colors.withHashPrefix."1";
"color9" = colors.withHashPrefix."9"; color9 = colors.withHashPrefix."9";
# green # green
"color2" = colors.withHashPrefix."2"; color2 = colors.withHashPrefix."2";
"color10" = colors.withHashPrefix."10"; color10 = colors.withHashPrefix."10";
# yellow # yellow
"color3" = colors.withHashPrefix."3"; color3 = colors.withHashPrefix."3";
"color11" = colors.withHashPrefix."11"; color11 = colors.withHashPrefix."11";
# blue # blue
"color4" = colors.withHashPrefix."4"; color4 = colors.withHashPrefix."4";
"color12" = colors.withHashPrefix."12"; color12 = colors.withHashPrefix."12";
# magenta # magenta
"color5" = colors.withHashPrefix."5"; color5 = colors.withHashPrefix."5";
"color13" = colors.withHashPrefix."13"; color13 = colors.withHashPrefix."13";
# cyan # cyan
"color6" = colors.withHashPrefix."6"; color6 = colors.withHashPrefix."6";
"color14" = colors.withHashPrefix."14"; color14 = colors.withHashPrefix."14";
# white # white
"color7" = colors.withHashPrefix."7"; color7 = colors.withHashPrefix."7";
"color15" = colors.withHashPrefix."15"; color15 = colors.withHashPrefix."15";
}; };
keybindings = { keybindings = {
"ctrl+shift+1" = "change_font_size all 12.5"; "ctrl+shift+1" = "change_font_size all 12.5";

View file

@ -5,6 +5,7 @@
... ...
}: { }: {
imports = with outputs.homeManagerModules; [ imports = with outputs.homeManagerModules; [
linux
desktop desktop
firefox firefox
]; ];

View file

@ -1,12 +1,4 @@
{ {pkgs, ...}: {
outputs,
pkgs,
...
}: {
imports = with outputs.homeManagerModules; [
common
];
home = { home = {
sessionVariables = { sessionVariables = {
MOZ_ENABLE_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1";
@ -15,6 +7,7 @@
programs.fish = { programs.fish = {
shellAliases = { shellAliases = {
# TODO: these aren't working?
sctl = "sudo systemctl"; sctl = "sudo systemctl";
bt = "bluetoothctl"; bt = "bluetoothctl";
pa = "pulsemixer"; pa = "pulsemixer";

View file

@ -0,0 +1,6 @@
{pkgs, ...}: {
programs.password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
};
}

View file

@ -1,5 +1,5 @@
#!/usr/bin/env sh #!/usr/bin/env sh
r="$(< "$HOME/.emoji.txt" sk --height 40%)" r="$(< "$HOME/.emoji.txt" fzf --height 40%)"
echo "$r" | awk '$0=$1' | tr -d '\n' | clip echo "$r" | awk '$0=$1' | tr -d '\n' | clip
echo "Copied $r emoji to your clipboard" echo "Copied $r emoji to your clipboard"

View file

@ -8,7 +8,6 @@
... ...
}: { }: {
imports = with outputs.homeManagerModules; [ imports = with outputs.homeManagerModules; [
linux
waybar waybar
mako mako
swaylock swaylock

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;
nssmdns4 = true;
};
}

View file

@ -2,17 +2,25 @@
config, config,
lib, lib,
inputs, inputs,
colors, outputs,
# outputs,
system, system,
pkgs, pkgs,
modulesPath,
... ...
}: { }: {
networking.hostName = lib.mkDefault "nixoslyte"; 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 inputs.home-manager.nixosModules.home-manager
]; ]
++ (with outputs.nixosModules; [
avahi
daniel
]);
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
@ -140,7 +148,7 @@
useXkbConfig = true; useXkbConfig = true;
earlySetup = true; earlySetup = true;
colors = with colors; [ colors = with outputs.colors; [
bg bg
red red
green green
@ -177,44 +185,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 +224,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";
} }

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

@ -0,0 +1,44 @@
{
inputs,
system,
outputs,
...
}: {
home-manager = {
extraSpecialArgs = {
inherit inputs outputs system;
inherit (outputs) colors font;
};
users.daniel = {
accounts.email.accounts = {
primary = {
primary = true;
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,18 +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"
kde-connect = import ./kde-connect.nix; "user-installed-applications"
} "wifi"
"gnome"
"kde-connect"
"printing"
"avahi"
"daniel"
"flanfam"
"flanfamkiosk"
])

17
modules/nixos/flanfam.nix Normal file
View file

@ -0,0 +1,17 @@
{...}: {
users.groups.flanfam = {};
users.users = {
flanfam = {
isNormalUser = true;
home = "/home/flanfam";
createHome = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
];
group = "flanfam";
extraGroups = ["users" "video"];
packages = [];
};
};
}

View file

@ -0,0 +1,17 @@
{...}: {
users.groups.flanfamkiosk = {};
users.users = {
flanfamkiosk = {
isNormalUser = true;
home = "/home/flanfamkiosk";
createHome = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
];
group = "flanfamkiosk";
extraGroups = ["users" "video"];
packages = [];
};
};
}

74
modules/nixos/gnome.nix Normal file
View file

@ -0,0 +1,74 @@
{pkgs, ...}: {
imports = [./pipewire.nix];
services.xserver.enable = true;
services.xserver.displayManager.gdm = {
enable = true;
};
hardware.pulseaudio.enable = false;
services.xserver.desktopManager.gnome = {
enable = true;
};
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "gnome3";
enableSSHSupport = true;
};
xdg.portal = {
enable = true;
};
services.dbus.enable = true;
services.gvfs = {
enable = true;
};
environment = {
variables = {
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
VISUAL = "hx";
PAGER = "less";
MANPAGER = "less";
};
systemPackages = with pkgs; [
brightnessctl
feh
# gimp
grim
# inkscape
# krita
libinput
libinput-gestures
libnotify
# lutris
# nil
# nixpkgs-fmt
noto-fonts
pamixer
# pavucontrol
playerctl
# pulseaudio
pulsemixer
# rclone
# restic
slurp
# steam
swaybg
swayidle
swaylock
# vlc
# vulkan-tools
waybar
# weechat
# wine
wl-clipboard
zathura
];
};
}

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;
@ -24,7 +28,6 @@
extraPortals = with pkgs; [ extraPortals = with pkgs; [
xdg-desktop-portal-wlr xdg-desktop-portal-wlr
xdg-desktop-portal-gtk
]; ];
}; };
@ -50,34 +53,34 @@
systemPackages = with pkgs; [ systemPackages = with pkgs; [
brightnessctl brightnessctl
feh feh
gimp # gimp
grim grim
inkscape # inkscape
krita # krita
libinput libinput
libinput-gestures libinput-gestures
libnotify libnotify
lutris # lutris
nil # nil
nixpkgs-fmt # nixpkgs-fmt
noto-fonts noto-fonts
pamixer pamixer
pavucontrol # pavucontrol
playerctl playerctl
pulseaudio # pulseaudio
pulsemixer pulsemixer
rclone # rclone
restic # restic
slurp slurp
steam # steam
swaybg swaybg
swayidle swayidle
swaylock swaylock
vlc # vlc
vulkan-tools # vulkan-tools
waybar waybar
weechat # weechat
wine # wine
wl-clipboard wl-clipboard
zathura zathura
]; ];

16
nixos/base.nix Normal file
View file

@ -0,0 +1,16 @@
{
outputs,
flake,
...
}: {
# a minimal, familiar setup that I can bootstrap atop
imports = with outputs.nixosModules; [
# may need to be tweaked based on the machine's paritioning scheme
flake.diskoConfigurations.standard
desktop-usage
wifi
];
# TODO: may not work for UEFI?
boot.loader.systemd-boot.enable = true;
}

View file

@ -1,55 +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
]);
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

@ -8,16 +8,16 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x01 0x00
sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00 sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
*/ */
{ {
# inputs, inputs,
outputs, outputs,
modulesPath,
config, config,
pkgs, pkgs,
system,
... ...
}: { }: {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix")
outputs.nixosModules.intel outputs.nixosModules.intel
inputs.api-lyte-dev.nixosModules.${system}.api-lyte-dev
# inputs.nix-minecraft.nixosModules.minecraft-servers # inputs.nix-minecraft.nixosModules.minecraft-servers
]; ];
@ -67,7 +67,7 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
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";

16
nixos/default.nix Normal file
View file

@ -0,0 +1,16 @@
with builtins; (listToAttrs (map (name: {
name = name;
value = {
system = "x86_64-linux";
modules = [./${name}.nix];
};
}) [
"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

@ -6,25 +6,57 @@
# config, # config,
pkgs, pkgs,
... ...
}: { }: let
scale = 1.25;
in {
networking.hostName = "foxtrot"; networking.hostName = "foxtrot";
imports = imports =
[ [
inputs.disko.nixosModules.disko
flake.diskoConfigurations.standard flake.diskoConfigurations.standard
inputs.hardware.nixosModules.framework-13-7040-amd
] ]
++ (with outputs.nixosModules; [ ++ (with outputs.nixosModules; [
desktop-usage desktop-usage
podman podman
postgres postgres
wifi wifi
hyprland # hyprland
]) ]);
++ [
inputs.hardware.nixosModules.framework-13-7040-amd home-manager.users.daniel = {
imports = with outputs.homeManagerModules; [
sway
pass
# sway-laptop
# hyprland
]; ];
home = {
stateVersion = "24.05";
};
wayland.windowManager.hyprland = {
settings = {
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
monitor = [
"eDP-1,2256x1504@60,0x0,${toString scale}"
];
};
};
wayland.windowManager.sway = {
config = {
output = {
"BOE 0x0BCA Unknown" = {
mode = "2256x1504@60Hz";
scale = toString scale;
};
};
};
};
};
# use updated ppd for framework 13: # use updated ppd for framework 13:
# source: https://community.frame.work/t/tracking-ppd-v-tlp-for-amd-ryzen-7040/39423/137?u=lytedev # source: https://community.frame.work/t/tracking-ppd-v-tlp-for-amd-ryzen-7040/39423/137?u=lytedev
nixpkgs.overlays = [ nixpkgs.overlays = [
@ -103,7 +135,7 @@
hardware.framework.amd-7040.preventWakeOnAC = true; hardware.framework.amd-7040.preventWakeOnAC = true;
boot = { boot = {
kernelPackages = pkgs.linuxPackages_latest; # seeing if using the stable kernel makes wow work kernelPackages = pkgs.linuxPackages_latest;
loader = { loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
@ -132,35 +164,23 @@
}; };
hardware.bluetooth = { hardware.bluetooth = {
enable = true; enable = true;
# TODO: when resuming from hibernation, it would be nice if this would
# simply resume the power state at the time of hibernation
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.power-profiles-daemon = {
'';
services.printing.drivers = [pkgs.gutenprint];
services.avahi = {
enable = true; enable = true;
reflector = true;
openFirewall = true;
nssmdns = true;
}; };
powerManagement.powertop.enable = true;
# disabled stuff here for posterity
services.fprintd = { services.fprintd = {
enable = false; enable = false;
# tod.enable = true; # tod.enable = true;
# tod.driver = pkgs.libfprint-2-tod1-goodix; # tod.driver = pkgs.libfprint-2-tod1-goodix;
}; };
services.power-profiles-daemon = {
enable = true;
};
services.tlp = { services.tlp = {
enable = false; enable = false;
settings = { settings = {
@ -175,16 +195,6 @@
CPU_MAX_PERF_ON_AC = 100; CPU_MAX_PERF_ON_AC = 100;
}; };
}; };
powerManagement.powertop.enable = true;
networking = {
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [22];
allowedUDPPorts = [];
};
};
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -1,6 +1,5 @@
{ {
flake, flake,
inputs,
outputs, outputs,
# lib, # lib,
# config, # config,
@ -11,7 +10,6 @@
imports = imports =
[ [
inputs.disko.nixosModules.disko
flake.diskoConfigurations.unencrypted flake.diskoConfigurations.unencrypted
] ]
++ (with outputs.nixosModules; [ ++ (with outputs.nixosModules; [

View file

@ -1,6 +1,5 @@
{ {
flake, flake,
inputs,
lib, lib,
# outputs, # outputs,
# config, # config,
@ -36,7 +35,6 @@ in {
networking.useDHCP = false; networking.useDHCP = false;
imports = [ imports = [
inputs.disko.nixosModules.disko
flake.diskoConfigurations.unencrypted flake.diskoConfigurations.unencrypted
]; ];

97
nixos/thablet.nix Normal file
View file

@ -0,0 +1,97 @@
{
flake,
inputs,
outputs,
lib,
config,
modulesPath,
...
}: {
networking.hostName = "thablet";
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
flake.diskoConfigurations.standard
inputs.hardware.nixosModules.lenovo-thinkpad-x1-yoga
]
++ (with outputs.nixosModules; [
desktop-usage
gnome
wifi
flanfam
flanfamkiosk
]);
home-manager.users.daniel = {
imports = 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;
};
};
boot.loader.systemd-boot.enable = true;
services.fprintd = {
# TODO: am I missing a driver? see arch wiki for this h/w
enable = true;
# tod.enable = true;
# tod.driver = pkgs.libfprint-2-tod1-goodix;
};
environment.systemPackages =
#with pkgs;
[];
programs.steam.enable = true;
programs.steam.remotePlay.openFirewall = true;
# https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Yoga_(Gen_3)#Using_acpi_call
systemd.services.activate-touch-hack = {
enable = true;
description = "Touch wake Thinkpad X1 Yoga 3rd gen hack";
unitConfig = {
After = ["suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target"];
};
serviceConfig = {
ExecStart = ''
/bin/sh -c "echo '\\_SB.PCI0.LPCB.EC._Q2A' > /proc/acpi/call"
'';
};
wantedBy = ["suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target"];
};
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel" "acpi_call"];
boot.extraModulePackages = with config.boot.kernelPackages; [acpi_call];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
system.stateVersion = "23.11";
}

View file

@ -32,20 +32,16 @@
imports = imports =
[ [
inputs.disko.nixosModules.disko
flake.diskoConfigurations.thinker flake.diskoConfigurations.thinker
inputs.hardware.nixosModules.lenovo-thinkpad-t480
inputs.hardware.nixosModules.common-pc-laptop-ssd
] ]
++ (with outputs.nixosModules; [ ++ (with outputs.nixosModules; [
desktop-usage desktop-usage
podman podman
postgres postgres
wifi wifi
]) ]);
++ [
inputs.hardware.nixosModules.lenovo-thinkpad-t480
inputs.hardware.nixosModules.common-pc-laptop-ssd
# ./relative-module.nix
];
boot = { boot = {
loader = { loader = {

View file

@ -3,4 +3,8 @@
path = ./rust; path = ./rust;
description = "A template for working on a Rust project"; description = "A template for working on a Rust project";
}; };
deno = {
path = ./deno;
description = "A template for working on a TypeScript and Deno project";
};
} }

1
templates/deno/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

2
templates/deno/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/target
/.direnv

View file

@ -0,0 +1,49 @@
[language-server.deno]
command = "deno"
args = ["lsp"]
config.hostInfo = "helix"
[[language]]
name = "javascript"
scope = "source.js"
injection-regex = "(js|javascript)"
language-id = "javascript"
file-types = ["js", "mjs", "cjs", "rules", "es6", "pac", "jakefile"]
shebangs = ["node"]
comment-token = "//"
language-servers = [ "deno" ]
indent = { tab-width = 2, unit = "\t" }
auto-format = true
[[language]]
name = "jsx"
scope = "source.jsx"
injection-regex = "jsx"
language-id = "javascriptreact"
file-types = ["jsx"]
comment-token = "//"
language-servers = [ "deno" ]
indent = { tab-width = 2, unit = "\t" }
grammar = "javascript"
auto-format = true
[[language]]
name = "typescript"
scope = "source.ts"
injection-regex = "(ts|typescript)"
file-types = ["ts", "mts", "cts"]
language-id = "typescript"
shebangs = ["deno", "ts-node"]
language-servers = [ "deno" ]
indent = { tab-width = 2, unit = "\t" }
auto-format = true
[[language]]
name = "tsx"
scope = "source.tsx"
injection-regex = "(tsx)"
language-id = "typescriptreact"
file-types = ["tsx"]
language-servers = [ "deno" ]
indent = { tab-width = 2, unit = "\t" }
auto-format = true

10
templates/deno/deno.jsonc Normal file
View file

@ -0,0 +1,10 @@
{
"tasks": {
"dev": "deno run -A --watch=src src/mod.ts",
},
"fmt": {
"useTabs": true,
"semiColons": false,
"singleQuote": true,
},
}

23
templates/deno/flake.nix Normal file
View file

@ -0,0 +1,23 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=bd645e8668ec6612439a9ee7e71f7eac4099d4f6";
outputs = {
self,
nixpkgs,
}: let
inherit (self) outputs;
supportedSystems = ["x86_64-linux"];
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
in {
devShells = forEachSupportedSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
deno-dev = pkgs.mkShell {
buildInputs = with pkgs; [
deno
];
};
default = outputs.devShells.${system}.deno-dev;
});
};
}

View file

@ -0,0 +1,5 @@
console.log("Hello, world!")
if (true) {
console.log("Truth!")
}

View file

@ -1,5 +1,5 @@
{ {
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=2c7f3c0fb7c08a0814627611d9d7d45ab6d75335"; inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=bd645e8668ec6612439a9ee7e71f7eac4099d4f6";
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,