Compare commits
1
Commits
main
..
064cbb594c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
064cbb594c |
Generated
+105
-57
@@ -1,6 +1,41 @@
|
||||
{
|
||||
"nodes": {
|
||||
"apple-silicon": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1748659443,
|
||||
"narHash": "sha256-dav2hzyCmXZ3n6lEZrfZBG51+g6PUhkzRl3d6Ypd9x0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-apple-silicon",
|
||||
"rev": "3ddc251d2acce5019b0fa770e224d068610a34e4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-2025-05-30",
|
||||
"repo": "nixos-apple-silicon",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"locked": {
|
||||
"lastModified": 1688025799,
|
||||
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "flake-compat",
|
||||
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1761588595,
|
||||
@@ -114,10 +149,10 @@
|
||||
},
|
||||
"ghostty": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-utils": "flake-utils",
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"zig": "zig",
|
||||
"zon2nix": "zon2nix"
|
||||
},
|
||||
@@ -179,26 +214,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager-unstable": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1794963576,
|
||||
"narHash": "sha256-+CPrP74GDJ63f7bgEFC9Av4hbxc7K9WUNv1ZVRifRe8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "2b13c9cb3aa20653e6f8ee0b7f8331a53ea9b0a9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -241,22 +256,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-flatpak": {
|
||||
"locked": {
|
||||
"lastModified": 1790428548,
|
||||
"narHash": "sha256-OsZ/I7v3ArCrk0XOUvkiU1dFtGtE1qZTHRGjvBXIKUU=",
|
||||
"owner": "gmodena",
|
||||
"repo": "nix-flatpak",
|
||||
"rev": "f1f045fc8b35ff59f88982c1752d3f3a42ca6a61",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "gmodena",
|
||||
"ref": "latest",
|
||||
"repo": "nix-flatpak",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixgl": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_3",
|
||||
@@ -278,17 +277,36 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1768032153,
|
||||
"narHash": "sha256-zvxtwlM8ZlulmZKyYCQAPpkm5dngSEnnHjmjV7Teloc=",
|
||||
"rev": "3146c6aa9995e7351a398e17470e15305e6e18ff",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre925418.3146c6aa9995/nixexprs.tar.xz"
|
||||
"lastModified": 1768584846,
|
||||
"narHash": "sha256-IRPmIOV2tPwxbhP/I9M5AmwhTC0lMPtoPStC+8T6xl0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "cce68f4a54fa4e3d633358364477f5cc1d782440",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"
|
||||
"owner": "NixOS",
|
||||
"ref": "master",
|
||||
"repo": "nixos-hardware",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1748460289,
|
||||
"narHash": "sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "96ec055edbe5ee227f28cdbc3f1ddf1df5965102",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-darwin": {
|
||||
@@ -307,13 +325,29 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"nixpkgs-electron-32": {
|
||||
"locked": {
|
||||
"lastModified": 1794890597,
|
||||
"narHash": "sha256-lME2lHoDHAaSHP3/okgiVoJ0icVEvsQH8LeU3We7tcc=",
|
||||
"lastModified": 1729595756,
|
||||
"narHash": "sha256-rNaLWDqjgy23Y6M3K/e7Kiyimq04ikDMrErpqgXWcV0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "04906337b6d53e8bb0eaf0470ae9f070a4d4eb55",
|
||||
"rev": "782740762fb281404740b6b7084d356c3dab1173",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "782740762fb281404740b6b7084d356c3dab1173",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1768564909,
|
||||
"narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e4bae1bd10c9c57b2cf517953ab70060a828ee6f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -324,6 +358,19 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1768032153,
|
||||
"narHash": "sha256-zvxtwlM8ZlulmZKyYCQAPpkm5dngSEnnHjmjV7Teloc=",
|
||||
"rev": "3146c6aa9995e7351a398e17470e15305e6e18ff",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre925418.3146c6aa9995/nixexprs.tar.xz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1768323494,
|
||||
"narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=",
|
||||
@@ -339,7 +386,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1749086602,
|
||||
"narHash": "sha256-DJcgJMekoxVesl9kKjfLPix2Nbr42i7cpEHJiTnBUwU=",
|
||||
@@ -355,7 +402,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"nixpkgs_5": {
|
||||
"locked": {
|
||||
"lastModified": 1747542820,
|
||||
"narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=",
|
||||
@@ -395,15 +442,16 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"apple-silicon": "apple-silicon",
|
||||
"ghostty": "ghostty",
|
||||
"godig": "godig",
|
||||
"home-manager": "home-manager_2",
|
||||
"home-manager-unstable": "home-manager-unstable",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nix-flatpak": "nix-flatpak",
|
||||
"nixgl": "nixgl",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs-darwin": "nixpkgs-darwin",
|
||||
"nixpkgs-electron-32": "nixpkgs-electron-32",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"opencode-tunneler": "opencode-tunneler",
|
||||
"sops-nix": "sops-nix",
|
||||
@@ -435,7 +483,7 @@
|
||||
"ssh-agent-switcher": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_5",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1749108251,
|
||||
@@ -544,7 +592,7 @@
|
||||
},
|
||||
"walker": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"nixpkgs": "nixpkgs_5",
|
||||
"systems": "systems_6"
|
||||
},
|
||||
"locked": {
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
nix-darwin.url = "github:LnL7/nix-darwin/nix-darwin-25.11";
|
||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs-darwin";
|
||||
|
||||
# Required for webcord.
|
||||
nixpkgs-electron-32.url = "github:NixOS/nixpkgs/782740762fb281404740b6b7084d356c3dab1173";
|
||||
|
||||
nixgl.url = "github:nix-community/nixGL";
|
||||
nixgl.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
@@ -16,16 +19,14 @@
|
||||
url = "github:mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
apple-silicon = {
|
||||
url = "github:nix-community/nixos-apple-silicon/release-2025-05-30";
|
||||
};
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
home-manager-unstable = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
# Declarative flatpaks.
|
||||
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest";
|
||||
ghostty = {
|
||||
url = "github:ghostty-org/ghostty";
|
||||
};
|
||||
@@ -67,6 +68,8 @@
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
nix-darwin,
|
||||
apple-silicon,
|
||||
nixos-hardware,
|
||||
home-manager,
|
||||
ghostty,
|
||||
nixgl,
|
||||
@@ -76,6 +79,50 @@
|
||||
...
|
||||
}@inputs: {
|
||||
nixosConfigurations = {
|
||||
nixlap = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
inherit inputs ghostty;
|
||||
};
|
||||
modules = [
|
||||
./hosts/nixlap/configuration.nix
|
||||
nixos-hardware.nixosModules.framework-13-7040-amd
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.jmug = import ./hosts/nixlap/home.nix;
|
||||
home-manager.users.root = import ./hosts/nixlap/home-root.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
asahi = let
|
||||
pkgs-unstable_aarch64-linux = import nixpkgs-unstable {
|
||||
system = "aarch64-linux";
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
in nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
specialArgs = {
|
||||
inherit inputs apple-silicon ghostty;
|
||||
};
|
||||
modules = [
|
||||
./hosts/asahi/configuration.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.extraSpecialArgs = {
|
||||
pkgs-unstable = pkgs-unstable_aarch64-linux;
|
||||
inherit inputs;
|
||||
};
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.jmug = import ./hosts/asahi/home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
devbox = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
@@ -84,17 +131,13 @@
|
||||
modules = [
|
||||
./hosts/devbox/configuration.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
({ config, ... }: {
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs ssh-agent-switcher;
|
||||
inherit (config) user;
|
||||
homeConfigurationName = "devbox";
|
||||
};
|
||||
{
|
||||
home-manager.extraSpecialArgs = { inherit inputs ssh-agent-switcher; };
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.jmug = import ./hosts/devbox/home.nix;
|
||||
home-manager.users.root = import ./hosts/devbox/home-root.nix;
|
||||
})
|
||||
}
|
||||
];
|
||||
};
|
||||
nixbox = let
|
||||
@@ -118,11 +161,11 @@
|
||||
inherit inputs;
|
||||
inherit ssh-agent-switcher;
|
||||
inherit (config) user;
|
||||
homeConfigurationName = "nixbox";
|
||||
};
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.jmug = import ./hosts/nixbox/home.nix;
|
||||
# home-manager.users.root = import ./hosts/devbox/home-root.nix;
|
||||
})
|
||||
];
|
||||
};
|
||||
@@ -152,7 +195,6 @@
|
||||
inherit (config) user;
|
||||
inherit opencode-tunneler;
|
||||
inherit godig;
|
||||
homeConfigurationName = "macbook";
|
||||
};
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
@@ -182,38 +224,10 @@
|
||||
./users/alarm/home.nix
|
||||
];
|
||||
};
|
||||
# Ubuntu desktop.
|
||||
# Apply with ./ubuntu/bootstrap.sh on first install (safe to rerun to sync).
|
||||
ubuntu = let
|
||||
pkgs = import nixpkgs-unstable {
|
||||
system = "x86_64-linux";
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
# Use the host's flatpak. Ubuntu sets
|
||||
# kernel.apparmor_restrict_unprivileged_userns=1 so so nixpkgs'
|
||||
# flatpak can't sandbox extra-data installs (e.g. Slack's apply_extra).
|
||||
(final: prev: {
|
||||
flatpak = final.writeShellScriptBin "flatpak" ''exec /usr/bin/flatpak "$@"'';
|
||||
})
|
||||
];
|
||||
};
|
||||
in inputs.home-manager-unstable.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
homeConfigurationName = "ubuntu";
|
||||
# Shared modules take a pkgs-unstable arg, for this config pkgs-unstable and pkgs are the same.
|
||||
pkgs-unstable = pkgs;
|
||||
};
|
||||
modules = [
|
||||
./hosts/ubuntu/home.nix
|
||||
];
|
||||
};
|
||||
# For machines that don't run NixOS.
|
||||
devbox = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
extraSpecialArgs = {
|
||||
homeConfigurationName = "devbox";
|
||||
pkgs-unstable = pkgs-unstable_x86_64-linux;
|
||||
};
|
||||
modules = [
|
||||
@@ -223,7 +237,6 @@
|
||||
armdevbox = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages."aarch64-linux";
|
||||
extraSpecialArgs = {
|
||||
homeConfigurationName = "armdevbox";
|
||||
pkgs-unstable = pkgs-unstable_aarch64-linux;
|
||||
};
|
||||
modules = [
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
calibre
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
-----------------------------------------------------
|
||||
-----------------------------------------------------
|
||||
-----------------------------------------------------
|
||||
------------- VSCode specific config ----------------
|
||||
-----------------------------------------------------
|
||||
-----------------------------------------------------
|
||||
-----------------------------------------------------
|
||||
-----------------------------------------------------
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<Space>', '<NOP>', {noremap = true, silent = true})
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
-- Exit insert mode with ,h.
|
||||
vim.api.nvim_set_keymap('i', ',h', '<ESC>', {noremap = true, silent = true})
|
||||
|
||||
-- Quick save.
|
||||
vim.api.nvim_set_keymap('n', '<Leader>fw', ':w<CR>', {silent = true})
|
||||
|
||||
-- Remap for colemak-dhm.
|
||||
-- Left.
|
||||
vim.api.nvim_set_keymap('', 'm', 'h', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('', 'h', 'm', {noremap = true, silent = true})
|
||||
-- Down.
|
||||
vim.api.nvim_set_keymap('', 'j', 'n', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('', 'n', 'j', {noremap = true, silent = true})
|
||||
-- Up.
|
||||
vim.api.nvim_set_keymap('', 'k', 'e', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('', 'e', 'k', {noremap = true, silent = true})
|
||||
-- Right.
|
||||
vim.api.nvim_set_keymap('', 'l', 'i', {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('', 'i', 'l', {noremap = true, silent = true})
|
||||
|
||||
-- C-g as ESC
|
||||
vim.api.nvim_set_keymap('n', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('i', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('v', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('s', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('x', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('c', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('o', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('l', '<C-g>', '<ESC>', {silent = true})
|
||||
vim.api.nvim_set_keymap('t', '<C-g>', '<ESC>', {silent = true})
|
||||
|
||||
-- Move right when in insert mode.
|
||||
vim.api.nvim_set_keymap("i", '<C-l>', '<Right>', {noremap = true, silent = true})
|
||||
|
||||
-- Lsp
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lgd', "<cmd>lua require('vscode-neovim').call('editor.action.goToDeclaration')<CR>", {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lgr', "<cmd>lua require('vscode-neovim').call('editor.action.referenceSearch.trigger')<CR>", {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>lr', "<cmd>lua require('vscode-neovim').call('editor.action.rename')<CR>", {noremap = true, silent = true})
|
||||
|
||||
-- Tab movement.
|
||||
vim.api.nvim_set_keymap('n', '<Leader>m', "<cmd>lua require('vscode-neovim').call('workbench.action.previousEditorInGroup')<CR>", {noremap = true, silent = true})
|
||||
vim.api.nvim_set_keymap('n', '<Leader>i', "<cmd>lua require('vscode-neovim').call('workbench.action.nextEditorInGroup')<CR>", {noremap = true, silent = true})
|
||||
@@ -17,7 +17,6 @@
|
||||
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
|
||||
"palenight.vim": { "branch": "master", "commit": "9e9b102c54b830b72f51917b6b86c3b3b02dcea2" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "84b9ba066d1860f7a586ce9cd732fd6c4f77d1d9" },
|
||||
"transparent.nvim": { "branch": "main", "commit": "a4145c52f5421f1626a4d7dc0f41e785c4439944" },
|
||||
|
||||
@@ -1,26 +1,13 @@
|
||||
local cmp = require('cmp')
|
||||
local snippy = require('snippy')
|
||||
|
||||
-- Neovim shifts wide floating menus back onto the screen. nvim-cmp otherwise
|
||||
-- anchors docs to the requested column, which can overlap the shifted menu.
|
||||
local entries_view = require('cmp.view.custom_entries_view')
|
||||
entries_view.info = function(self)
|
||||
local info = self.entries_win:info()
|
||||
info.col = math.max(0, math.min(info.col, vim.o.columns - info.width))
|
||||
return info
|
||||
end
|
||||
|
||||
vim.opt.completeopt = { 'menuone', 'noselect' }
|
||||
vim.opt.shortmess:append('c')
|
||||
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered({ border = 'rounded' }),
|
||||
documentation = cmp.config.window.bordered({
|
||||
border = 'rounded',
|
||||
-- Leave a column between the menu and docs, on either side.
|
||||
col_offset = 1,
|
||||
}),
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
|
||||
@@ -2,8 +2,6 @@ local map = vim.keymap.set
|
||||
|
||||
map('n', '<Space>', '<Nop>', { silent = true })
|
||||
map('i', ',m', '<Esc>', { silent = true })
|
||||
-- Preserve a pending comma from the ,m mapping when leaving insert mode.
|
||||
map('i', '<C-c>', '<Esc>', { silent = true })
|
||||
|
||||
for _, mode in ipairs({ 'n', 'i', 'v', 's', 'x', 'c', 'o', 't' }) do
|
||||
map(mode, '<C-g>', '<Esc>', { silent = true })
|
||||
@@ -16,43 +14,11 @@ end
|
||||
map('n', '<leader>fw', '<cmd>write<cr>', { desc = 'Write file' })
|
||||
map('n', '<leader><leader>', '<C-^>', { desc = 'Alternate buffer' })
|
||||
|
||||
map('n', '<leader>ff', function()
|
||||
-- Include dotfiles; rg (telescope's preferred backend) hides them by default,
|
||||
-- while a plain --hidden would flood results with .git internals.
|
||||
if vim.fn.executable('rg') == 1 then
|
||||
require('telescope.builtin').find_files({
|
||||
find_command = { 'rg', '--files', '--hidden', '--glob', '!.git', '--color', 'never' },
|
||||
})
|
||||
else
|
||||
require('telescope.builtin').find_files({ hidden = true })
|
||||
end
|
||||
end, { desc = 'Find files' })
|
||||
map('n', '<leader>ff', '<cmd>Telescope find_files<cr>', { desc = 'Find files' })
|
||||
map('n', '<leader>fb', '<cmd>Oil .<cr>', { desc = 'Browse current directory' })
|
||||
map('n', '<leader>fc', function()
|
||||
-- With no file in the buffer there is no directory to search; warn rather
|
||||
-- than let expand('%:p:h') fall back to the cwd (the whole project).
|
||||
local dir
|
||||
if vim.bo.filetype == 'oil' then
|
||||
dir = require('oil').get_current_dir()
|
||||
else
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
if bufname ~= '' then
|
||||
dir = vim.fn.fnamemodify(bufname, ':p:h')
|
||||
end
|
||||
end
|
||||
if not dir or vim.fn.isdirectory(dir) ~= 1 then
|
||||
vim.notify('No file to find alongside of (try <leader>ff)', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
require('telescope').extensions.file_browser.file_browser({ path = dir })
|
||||
end, { desc = 'Fuzzy-browse file directory' })
|
||||
map('n', '<leader>fo', '<cmd>Oil<cr>', { desc = 'Browse file directory' })
|
||||
map('n', '<leader>ps', function()
|
||||
require('telescope.builtin').live_grep({
|
||||
-- See <leader>ff: include dotfiles, but not .git's contents.
|
||||
additional_args = { '--hidden', '--glob', '!.git' },
|
||||
})
|
||||
end, { desc = 'Search text' })
|
||||
map('n', '<leader>fc', '<cmd>Oil<cr>', { desc = 'Browse file directory' })
|
||||
map('n', '<leader>fo', '<cmd>Oil<cr>', { desc = 'Open file directory' })
|
||||
map('n', '<leader>ps', '<cmd>Telescope live_grep<cr>', { desc = 'Search text' })
|
||||
map('n', '<leader>bs', '<cmd>Telescope buffers<cr>', { desc = 'Search buffers' })
|
||||
map('n', '<leader>sr', '<cmd>GrugFar<cr>', { desc = 'Search and replace' })
|
||||
map('n', '<leader>rsr', '<cmd>GrugFarWithin<cr>', { desc = 'Open range replacement' })
|
||||
|
||||
@@ -5,12 +5,6 @@ for _, server in ipairs({ 'ts_ls', 'basedpyright', 'gopls', 'zls', 'clangd', 'ru
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
|
||||
-- Bare-metal cross-compile: clangd won't execute an unlisted driver,
|
||||
-- so allowlist the Arm one to get its newlib/ARM system include paths.
|
||||
vim.lsp.config('clangd', {
|
||||
cmd = { 'clangd', '--query-driver=**/arm-none-eabi-*' },
|
||||
})
|
||||
|
||||
vim.lsp.config('lua_ls', {
|
||||
capabilities = capabilities,
|
||||
on_init = function(client)
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
require('telescope').setup({
|
||||
extensions = {
|
||||
['ui-select'] = require('telescope.themes').get_dropdown({}),
|
||||
['file_browser'] = {
|
||||
-- oil.nvim already owns directory buffers.
|
||||
hijack_netrw = false,
|
||||
-- List dotfiles by default like oil; toggle with h / <C-h>.
|
||||
hidden = { file_browser = true, folder_browser = true },
|
||||
-- One grouped section of folders at the top.
|
||||
grouped = true,
|
||||
dir_icon_hl = 'Directory',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require('telescope').load_extension('ui-select')
|
||||
require('telescope').load_extension('file_browser')
|
||||
|
||||
@@ -53,9 +53,7 @@ require('lazy').setup({
|
||||
}, config = function()
|
||||
require('nv-telescope')
|
||||
end },
|
||||
{ 'nvim-telescope/telescope-file-browser.nvim', lazy = false,
|
||||
commit = '3610dc7dc91f06aa98b11dca5cc30dfa98626b7e' },
|
||||
{ 'stevearc/oil.nvim', opts = { view_options = { show_hidden = true } } },
|
||||
{ 'stevearc/oil.nvim', opts = {} },
|
||||
{ 'MagicDuck/grug-far.nvim', opts = {} },
|
||||
|
||||
-- Diagnostics, Git, and editing
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, ... }: {
|
||||
{ lib, config, ... }: {
|
||||
options.ghostty.font-size = lib.mkOption {
|
||||
# Using a string to support floats.
|
||||
type = lib.types.str;
|
||||
@@ -21,11 +21,6 @@
|
||||
# This is the default to open the configuration
|
||||
# I type this by accident way to frequently...
|
||||
keybind = ctrl+comma=unbind
|
||||
'' + lib.optionalString pkgs.stdenv.hostPlatform.isLinux ''
|
||||
|
||||
# Support configs where Meta+C/V is turned into Ctrl+Insert/Shift+Insert.
|
||||
keybind = ctrl+insert=copy_to_clipboard
|
||||
keybind = shift+insert=paste_from_clipboard
|
||||
'';
|
||||
};
|
||||
config.home.file.".config/ghostty/themes/PaleNight" = {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
{ ... }: {
|
||||
home.file.".config/ghostty/config" = {
|
||||
text = ''
|
||||
# If not preset, this causes issues when sshing into linux servers.
|
||||
term = xterm-256color
|
||||
font-family = "BigBlueTermPlus Nerd Font"
|
||||
font-size = 17.2
|
||||
theme = "PaleNight"
|
||||
background-opacity = 0.9
|
||||
window-decoration = true
|
||||
|
||||
# This is the default to open the configuration
|
||||
# I type this by accident way to frequently...
|
||||
keybind = ctrl+comma=unbind
|
||||
'';
|
||||
};
|
||||
home.file.".config/ghostty/themes/PaleNight" = {
|
||||
text = ''
|
||||
palette = 0=#000000
|
||||
palette = 1=#ff5555
|
||||
palette = 2=#50fa7b
|
||||
palette = 3=#f1fa8c
|
||||
palette = 4=#caa9fa
|
||||
palette = 5=#ff79c6
|
||||
palette = 6=#8be9fd
|
||||
palette = 7=#bfbfbf
|
||||
palette = 8=#575b70
|
||||
palette = 9=#ff6e67
|
||||
palette = 10=#5af78e
|
||||
palette = 11=#f4f99d
|
||||
palette = 12=#caa9fa
|
||||
palette = 13=#ff92d0
|
||||
palette = 14=#9aedfe
|
||||
palette = 15=#e6e6e6
|
||||
background = 282a36
|
||||
foreground = f8f8f2
|
||||
cursor-color = #ffcb6b
|
||||
selection-background = #717cb4
|
||||
selection-foreground = #80cbc4
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
{ ... }: {
|
||||
|
||||
home.file.".config/herdr/config.toml" = {
|
||||
text = ''
|
||||
onboarding = false
|
||||
|
||||
[keys]
|
||||
prefix = "ctrl+a"
|
||||
|
||||
# Use tmux-style session selection for workspace navigation.
|
||||
workspace_picker = "prefix+s"
|
||||
settings = "prefix+shift+s"
|
||||
|
||||
# j/k switch workspaces in the picker; pane up/down move to the arrows.
|
||||
navigate_workspace_up = "k"
|
||||
navigate_workspace_down = "j"
|
||||
navigate_pane_up = "up"
|
||||
navigate_pane_down = "down"
|
||||
|
||||
# Side-by-side panes (tmux's "|" / "\" split -h).
|
||||
# NOTE: "backslash" as a key name is inferred, not confirmed in the docs.
|
||||
# Verify against `herdr --default-config` and adjust if it doesn't bind.
|
||||
split_vertical = "prefix+backslash"
|
||||
|
||||
# Stacked panes (tmux's "-" / "_" split -v).
|
||||
split_horizontal = "prefix+minus"
|
||||
|
||||
detach = "prefix+d"
|
||||
|
||||
# Kept "f" for next-tab like the old tmux config; herdr's
|
||||
# previous_tab default (prefix+p) already matched.
|
||||
next_tab = "prefix+f"
|
||||
|
||||
close_pane = "prefix+w"
|
||||
close_tab = "prefix+shift+w"
|
||||
|
||||
# Kept "," for rename-tab like the old tmux default.
|
||||
rename_tab = "prefix+,"
|
||||
|
||||
[ui]
|
||||
mouse_capture = true
|
||||
|
||||
[session]
|
||||
# Replaces tmux-resurrect/continuum: agents and panes come back on reattach.
|
||||
resume_agents_on_restore = true
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,298 +0,0 @@
|
||||
// Managed by Home Manager (home-modules/niri). Local edits get overwritten.
|
||||
// https://niri-wm.github.io/niri/Configuration:-Introduction
|
||||
//
|
||||
// keyd turns Meta+C/V/X into copy/paste/cut before niri sees them, so center
|
||||
// is on Mod+Backslash and floating on Mod+P instead.
|
||||
|
||||
input {
|
||||
keyboard {
|
||||
xkb {
|
||||
layout "us"
|
||||
}
|
||||
}
|
||||
|
||||
// No tap-to-click; two-finger click is right click.
|
||||
touchpad {
|
||||
natural-scroll
|
||||
dwt
|
||||
click-method "clickfinger"
|
||||
scroll-factor 0.75
|
||||
}
|
||||
|
||||
// Only onto fully visible windows, so hovering never scrolls the view.
|
||||
focus-follows-mouse max-scroll-amount="0%"
|
||||
}
|
||||
|
||||
// The top-left hot corner toggles the overview by default; only Mod+O should.
|
||||
gestures {
|
||||
hot-corners {
|
||||
off
|
||||
}
|
||||
}
|
||||
|
||||
// `niri msg outputs` lists names and modes.
|
||||
output "eDP-1" {
|
||||
scale 1.6
|
||||
}
|
||||
|
||||
output "HDMI-A-1" {
|
||||
mode "3840x2160"
|
||||
scale 1.333333
|
||||
}
|
||||
|
||||
layout {
|
||||
gaps 8
|
||||
center-focused-column "never"
|
||||
|
||||
// Mod+R cycles through these.
|
||||
preset-column-widths {
|
||||
proportion 0.33333
|
||||
proportion 0.5
|
||||
proportion 0.66667
|
||||
}
|
||||
default-column-width { proportion 0.5; }
|
||||
|
||||
focus-ring {
|
||||
off
|
||||
}
|
||||
|
||||
// Fallback; noctalia.kdl overrides these. No gradients: they'd win over
|
||||
// its solid colors.
|
||||
border {
|
||||
width 2
|
||||
active-color "#ffc33b"
|
||||
inactive-color "#595959aa"
|
||||
urgent-color "#9b0000"
|
||||
}
|
||||
|
||||
shadow {
|
||||
on
|
||||
softness 30
|
||||
spread 5
|
||||
offset x=0 y=5
|
||||
color "#0007"
|
||||
}
|
||||
|
||||
// Shows Noctalia's wallpaper on the backdrop.
|
||||
background-color "transparent"
|
||||
}
|
||||
|
||||
// Border/focus colors from the wallpaper, written by Noctalia's niri template.
|
||||
include optional=true "noctalia.kdl"
|
||||
|
||||
spawn-at-startup "noctalia"
|
||||
spawn-at-startup "tailscale" "systray"
|
||||
|
||||
// Add `skip-at-startup` to stop the popup at login.
|
||||
hotkey-overlay {
|
||||
}
|
||||
|
||||
prefer-no-csd
|
||||
|
||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||
|
||||
animations {
|
||||
}
|
||||
|
||||
// Wallpaper stays put while workspaces scroll.
|
||||
// https://docs.noctalia.dev/noctalia/compositors/niri/
|
||||
layer-rule {
|
||||
match namespace="^noctalia-wallpaper"
|
||||
place-within-backdrop true
|
||||
}
|
||||
|
||||
overview {
|
||||
workspace-shadow {
|
||||
off
|
||||
}
|
||||
}
|
||||
|
||||
window-rule {
|
||||
geometry-corner-radius 5
|
||||
clip-to-geometry true
|
||||
}
|
||||
|
||||
window-rule {
|
||||
match title="^Picture-in-Picture$"
|
||||
open-floating true
|
||||
}
|
||||
|
||||
window-rule {
|
||||
match app-id="dev.noctalia.Noctalia"
|
||||
open-floating true
|
||||
default-column-width { fixed 1080; }
|
||||
default-window-height { fixed 920; }
|
||||
}
|
||||
|
||||
// Lets Noctalia notification actions focus the app that sent them.
|
||||
debug {
|
||||
honor-xdg-activation-with-invalid-serial
|
||||
}
|
||||
|
||||
binds {
|
||||
Mod+Shift+Slash { show-hotkey-overlay; }
|
||||
|
||||
Mod+Return hotkey-overlay-title="Open a Terminal: ghostty" { spawn "ghostty"; }
|
||||
Mod+Space repeat=false hotkey-overlay-title="Launcher" { spawn "noctalia" "msg" "panel-toggle" "launcher"; }
|
||||
Mod+S repeat=false hotkey-overlay-title="Control Center" { spawn "noctalia" "msg" "panel-toggle" "control-center"; }
|
||||
Mod+Shift+Comma repeat=false hotkey-overlay-title="Noctalia Settings" { spawn "noctalia" "msg" "settings-toggle"; }
|
||||
Mod+Ctrl+Q hotkey-overlay-title="Lock the Screen" { spawn "noctalia" "msg" "session" "lock"; }
|
||||
|
||||
// Through Noctalia so they show its OSD.
|
||||
XF86AudioRaiseVolume allow-when-locked=true { spawn "noctalia" "msg" "volume-up"; }
|
||||
XF86AudioLowerVolume allow-when-locked=true { spawn "noctalia" "msg" "volume-down"; }
|
||||
XF86AudioMute allow-when-locked=true { spawn "noctalia" "msg" "volume-mute"; }
|
||||
XF86AudioMicMute allow-when-locked=true { spawn "noctalia" "msg" "mic-mute"; }
|
||||
XF86MonBrightnessUp allow-when-locked=true { spawn "noctalia" "msg" "brightness-up"; }
|
||||
XF86MonBrightnessDown allow-when-locked=true { spawn "noctalia" "msg" "brightness-down"; }
|
||||
XF86AudioPlay allow-when-locked=true { spawn "noctalia" "msg" "media" "toggle"; }
|
||||
XF86AudioPause allow-when-locked=true { spawn "noctalia" "msg" "media" "toggle"; }
|
||||
XF86AudioStop allow-when-locked=true { spawn "noctalia" "msg" "media" "stop"; }
|
||||
XF86AudioPrev allow-when-locked=true { spawn "noctalia" "msg" "media" "previous"; }
|
||||
XF86AudioNext allow-when-locked=true { spawn "noctalia" "msg" "media" "next"; }
|
||||
|
||||
Mod+O repeat=false { toggle-overview; }
|
||||
|
||||
Mod+W repeat=false { close-window; }
|
||||
Mod+Q repeat=false { close-window; }
|
||||
|
||||
// Mod+Left/Right also serve the MX Master 3's thumb buttons (logid):
|
||||
// keyd rewrites Meta+arrows to Home/End on real keyboards.
|
||||
Mod+Left { focus-column-left; }
|
||||
Mod+Down { focus-window-down; }
|
||||
Mod+Up { focus-window-up; }
|
||||
Mod+Right { focus-column-right; }
|
||||
Mod+H { focus-column-left; }
|
||||
Mod+J { focus-window-down; }
|
||||
Mod+K { focus-window-up; }
|
||||
Mod+L { focus-column-right; }
|
||||
// Also the MX Master thumb buttons (logid).
|
||||
Mod+Page_Down { focus-column-right; }
|
||||
Mod+Page_Up { focus-column-left; }
|
||||
|
||||
Mod+Ctrl+Left { move-column-left; }
|
||||
Mod+Ctrl+Down { move-window-down; }
|
||||
Mod+Ctrl+Up { move-window-up; }
|
||||
Mod+Ctrl+Right { move-column-right; }
|
||||
Mod+Ctrl+H { move-column-left; }
|
||||
Mod+Ctrl+J { move-window-down; }
|
||||
Mod+Ctrl+K { move-window-up; }
|
||||
Mod+Ctrl+L { move-column-right; }
|
||||
|
||||
Mod+Home { focus-column-first; }
|
||||
Mod+End { focus-column-last; }
|
||||
Mod+Ctrl+Home { move-column-to-first; }
|
||||
Mod+Ctrl+End { move-column-to-last; }
|
||||
|
||||
Mod+Shift+Left { focus-monitor-left; }
|
||||
Mod+Shift+Down { focus-monitor-down; }
|
||||
Mod+Shift+Up { focus-monitor-up; }
|
||||
Mod+Shift+Right { focus-monitor-right; }
|
||||
Mod+Shift+H { focus-monitor-left; }
|
||||
Mod+Shift+J { focus-monitor-down; }
|
||||
Mod+Shift+K { focus-monitor-up; }
|
||||
Mod+Shift+L { focus-monitor-right; }
|
||||
|
||||
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
|
||||
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
|
||||
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
|
||||
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
|
||||
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
|
||||
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
|
||||
|
||||
Mod+U { focus-workspace-down; }
|
||||
Mod+I { focus-workspace-up; }
|
||||
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
|
||||
Mod+Ctrl+U { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+I { move-column-to-workspace-up; }
|
||||
|
||||
Mod+Shift+Page_Down { move-workspace-down; }
|
||||
Mod+Shift+Page_Up { move-workspace-up; }
|
||||
Mod+Shift+U { move-workspace-down; }
|
||||
Mod+Shift+I { move-workspace-up; }
|
||||
|
||||
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
|
||||
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
|
||||
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
|
||||
|
||||
Mod+WheelScrollRight { focus-column-right; }
|
||||
Mod+WheelScrollLeft { focus-column-left; }
|
||||
Mod+Ctrl+WheelScrollRight { move-column-right; }
|
||||
Mod+Ctrl+WheelScrollLeft { move-column-left; }
|
||||
|
||||
Mod+Shift+WheelScrollDown { focus-column-right; }
|
||||
Mod+Shift+WheelScrollUp { focus-column-left; }
|
||||
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
|
||||
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
|
||||
|
||||
Mod+1 { focus-workspace 1; }
|
||||
Mod+2 { focus-workspace 2; }
|
||||
Mod+3 { focus-workspace 3; }
|
||||
Mod+4 { focus-workspace 4; }
|
||||
Mod+5 { focus-workspace 5; }
|
||||
Mod+6 { focus-workspace 6; }
|
||||
Mod+7 { focus-workspace 7; }
|
||||
Mod+8 { focus-workspace 8; }
|
||||
Mod+9 { focus-workspace 9; }
|
||||
Mod+Shift+1 { move-column-to-workspace 1; }
|
||||
Mod+Shift+2 { move-column-to-workspace 2; }
|
||||
Mod+Shift+3 { move-column-to-workspace 3; }
|
||||
Mod+Shift+4 { move-column-to-workspace 4; }
|
||||
Mod+Shift+5 { move-column-to-workspace 5; }
|
||||
Mod+Shift+6 { move-column-to-workspace 6; }
|
||||
Mod+Shift+7 { move-column-to-workspace 7; }
|
||||
Mod+Shift+8 { move-column-to-workspace 8; }
|
||||
Mod+Shift+9 { move-column-to-workspace 9; }
|
||||
Mod+Ctrl+1 { move-column-to-workspace 1; }
|
||||
Mod+Ctrl+2 { move-column-to-workspace 2; }
|
||||
Mod+Ctrl+3 { move-column-to-workspace 3; }
|
||||
Mod+Ctrl+4 { move-column-to-workspace 4; }
|
||||
Mod+Ctrl+5 { move-column-to-workspace 5; }
|
||||
Mod+Ctrl+6 { move-column-to-workspace 6; }
|
||||
Mod+Ctrl+7 { move-column-to-workspace 7; }
|
||||
Mod+Ctrl+8 { move-column-to-workspace 8; }
|
||||
Mod+Ctrl+9 { move-column-to-workspace 9; }
|
||||
|
||||
Mod+BracketLeft { consume-or-expel-window-left; }
|
||||
Mod+BracketRight { consume-or-expel-window-right; }
|
||||
Mod+Comma { consume-window-into-column; }
|
||||
Mod+Period { expel-window-from-column; }
|
||||
Mod+T { toggle-column-tabbed-display; }
|
||||
|
||||
Mod+R { switch-preset-column-width; }
|
||||
Mod+Shift+R { switch-preset-column-width-back; }
|
||||
Mod+Ctrl+Shift+R { switch-preset-window-height; }
|
||||
Mod+Ctrl+R { reset-window-height; }
|
||||
|
||||
Mod+F { maximize-column; }
|
||||
Mod+Shift+F { fullscreen-window; }
|
||||
Mod+M { maximize-window-to-edges; }
|
||||
Mod+Ctrl+F { expand-column-to-available-width; }
|
||||
|
||||
Mod+Backslash { center-column; }
|
||||
Mod+Ctrl+Backslash { center-visible-columns; }
|
||||
|
||||
Mod+Minus { set-column-width "-10%"; }
|
||||
Mod+Equal { set-column-width "+10%"; }
|
||||
Mod+Shift+Minus { set-window-height "-10%"; }
|
||||
Mod+Shift+Equal { set-window-height "+10%"; }
|
||||
|
||||
Mod+P { toggle-window-floating; }
|
||||
Mod+Shift+P { switch-focus-between-floating-and-tiling; }
|
||||
|
||||
Print { screenshot; }
|
||||
Mod+Shift+S { screenshot; }
|
||||
Ctrl+Print { screenshot-screen; }
|
||||
Alt+Print { screenshot-window; }
|
||||
|
||||
// For apps that grab the keyboard (remote desktop, VMs).
|
||||
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
|
||||
|
||||
Mod+Shift+Q { quit; }
|
||||
Mod+Shift+E { quit; }
|
||||
Ctrl+Alt+Delete { quit; }
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
# niri + Noctalia config. The binaries come from apt.
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
# Fail `homesw` on a bad config. The nix packages only validate, so they
|
||||
# should match the apt versions.
|
||||
checked = name: src: check: pkgs.runCommand name { } ''
|
||||
${check src}
|
||||
cp ${src} $out
|
||||
'';
|
||||
in {
|
||||
xdg.configFile."niri/config.kdl".source = checked "niri-config.kdl" ./config.kdl
|
||||
(src: "${pkgs.niri}/bin/niri validate -c ${src}");
|
||||
|
||||
# noctalia only warns on unknown keys.
|
||||
xdg.configFile."noctalia/config.toml".source = checked "noctalia-config.toml"
|
||||
(pkgs.replaceVars ./noctalia.toml {
|
||||
# Linked by ../wallpapers.nix.
|
||||
wallpapers = "${config.home.homeDirectory}/Pictures/Wallpapers";
|
||||
})
|
||||
(src: ''
|
||||
log=$(${pkgs.noctalia}/bin/noctalia config validate ${src} 2>&1) || { echo "$log"; exit 1; }
|
||||
echo "$log"
|
||||
if echo "$log" | grep -q WARN; then exit 1; fi
|
||||
'');
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
# Managed by Home Manager (home-modules/niri). Local edits get overwritten.
|
||||
# Settings UI changes go to ~/.local/state/noctalia/settings.toml and win over
|
||||
# this file. `noctalia config export` prints the merged result.
|
||||
# https://docs.noctalia.dev/noctalia/configuration/
|
||||
# The wallpaper paths are filled in by default.nix.
|
||||
|
||||
[wallpaper]
|
||||
directory = "@wallpapers@"
|
||||
|
||||
[wallpaper.default]
|
||||
path = "@wallpapers@/Macintosh-1.png"
|
||||
|
||||
# "faithful" stays closest to the wallpaper's own colors.
|
||||
[theme]
|
||||
source = "wallpaper"
|
||||
wallpaper_scheme = "faithful"
|
||||
|
||||
# Writes ~/.config/niri/noctalia.kdl, included by config.kdl.
|
||||
[theme.templates]
|
||||
builtin_ids = ["niri"]
|
||||
|
||||
# Lock at 10 min, screens off 30 s later.
|
||||
[idle.behavior.lock]
|
||||
action = "lock"
|
||||
timeout = 600
|
||||
enabled = true
|
||||
|
||||
[idle.behavior.screen-off]
|
||||
action = "screen_off"
|
||||
timeout = 630
|
||||
enabled = true
|
||||
|
||||
# "clock" is the bar's built-in center widget; e.g. "Mon Nov 30 14:32".
|
||||
# https://docs.noctalia.dev/noctalia/bar/widgets/clock/
|
||||
[widget.clock]
|
||||
format = "{:%a %b %d %H:%M}"
|
||||
@@ -1,89 +1,19 @@
|
||||
{ ... }:
|
||||
let
|
||||
# W&B Inference (CoreWeave), OpenAI-compatible.
|
||||
# The API key is NOT in this repo. Put it on each machine with:
|
||||
# mkdir -p ~/.keys && install -m 600 /dev/stdin ~/.keys/wandb
|
||||
# (paste the key, then Ctrl-D)
|
||||
# NOTE: opencode refuses to start if a {file:...} reference is missing.
|
||||
wandbTokenFile = "~/.keys/wandb";
|
||||
|
||||
# Model IDs from https://docs.coreweave.com/inference/models (Nov 2026).
|
||||
# Prices are $/1M tokens, input/output.
|
||||
wandbModels = {
|
||||
# Quality.
|
||||
"zai-org/GLM-5.3" = { name = "GLM 5.3"; context = 1048576; }; # $0.75/$3.00
|
||||
"moonshotai/Kimi-K2.7-Code" = { name = "Kimi K2.7 Code"; context = 262144; }; # $0.60/$3.00
|
||||
"deepseek-ai/DeepSeek-V4-Pro-0813" = { name = "DeepSeek V4 Pro"; context = 1048576; }; # $1.31/$3.96
|
||||
# Balanced.
|
||||
"deepseek-ai/DeepSeek-V4.1-Flash-1017" = { name = "DeepSeek V4.1 Flash 1017"; context = 1048576; }; # $0.30/$1.20
|
||||
"MiniMaxAI/MiniMax-M3" = { name = "MiniMax M3"; context = 262144; }; # $0.23/$0.96
|
||||
# Speed.
|
||||
"zai-org/GLM-5.3-Flash" = { name = "GLM 5.3 Flash"; context = 1048576; }; # $0.12/$0.38
|
||||
"nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B" = { name = "Nemotron 3.5 Lightning"; context = 262144; }; # $0.07/$0.20
|
||||
{ ... } : {
|
||||
home.file.".config/opencode/opencode.jsonc" = {
|
||||
text = ''
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"permission": {
|
||||
"edit": "ask",
|
||||
"webfetch": "ask",
|
||||
"bash": {
|
||||
"git status": "allow",
|
||||
"git diff": "allow",
|
||||
"ls": "allow",
|
||||
"pwd": "allow"
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
fastModel = "wandb/zai-org/GLM-5.3-Flash";
|
||||
|
||||
rule = action: resource: effect: { inherit action resource effect; };
|
||||
|
||||
# Last matching rule wins; unmatched checks default to "ask".
|
||||
# `opencode --auto` (alias: oca) turns every "ask" into "allow", but "deny"
|
||||
# is still enforced, so the deny list below is the guardrail for auto mode.
|
||||
permissions = [
|
||||
# Normal (non-auto) mode: prompt for edits and fetches.
|
||||
(rule "edit" "*" "ask")
|
||||
(rule "webfetch" "*" "ask")
|
||||
(rule "shell" "git status *" "allow")
|
||||
(rule "shell" "git diff *" "allow")
|
||||
(rule "shell" "git log *" "allow")
|
||||
(rule "shell" "ls *" "allow")
|
||||
(rule "shell" "pwd" "allow")
|
||||
|
||||
# Hard denies, in every mode.
|
||||
(rule "shell" "sudo *" "deny")
|
||||
(rule "shell" "git push *--force*" "deny")
|
||||
(rule "shell" "git push * -f" "deny")
|
||||
(rule "shell" "git push * -f *" "deny")
|
||||
(rule "shell" "git push -f *" "deny")
|
||||
(rule "shell" "git reset --hard *" "deny")
|
||||
(rule "shell" "git clean *" "deny")
|
||||
(rule "shell" "rm -rf /*" "deny")
|
||||
(rule "shell" "rm -rf ~*" "deny")
|
||||
] ++ builtins.concatMap (dir: [
|
||||
(rule "read" dir "deny")
|
||||
(rule "edit" dir "deny")
|
||||
]) [ "~/.keys/*" "~/.ssh/*" "~/.aws/*" "~/.config/sops/*" ];
|
||||
|
||||
opencodeConfig = {
|
||||
"$schema" = "https://opencode.ai/config.json";
|
||||
|
||||
model = "wandb/zai-org/GLM-5.3";
|
||||
# Cheap background calls.
|
||||
agents = {
|
||||
title.model = fastModel;
|
||||
summary.model = fastModel;
|
||||
};
|
||||
|
||||
providers.wandb = {
|
||||
name = "W&B Inference";
|
||||
package = "@opencode/ai/providers/openai-compatible";
|
||||
settings = {
|
||||
baseURL = "https://api.inference.wandb.ai/v1";
|
||||
apiKey = "{file:${wandbTokenFile}}";
|
||||
};
|
||||
# "<team>/<project>" to bill against. Required when the account is in
|
||||
# several teams; the default entity (coreweave1) rejects this key.
|
||||
headers."OpenAI-Project" = "cw-wb/at";
|
||||
models = builtins.mapAttrs (_: m: {
|
||||
inherit (m) name;
|
||||
limit = { inherit (m) context; output = 32768; };
|
||||
}) wandbModels;
|
||||
};
|
||||
|
||||
inherit permissions;
|
||||
};
|
||||
in {
|
||||
home.file.".config/opencode/opencode.jsonc".text = builtins.toJSON opencodeConfig;
|
||||
|
||||
programs.zsh.shellAliases.oca = "opencode --auto";
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
# Glue for running Home Manager on Ubuntu.
|
||||
{ config, ... }: {
|
||||
# Nix-installed apps/fonts/terminfo visible to the host system.
|
||||
targets.genericLinux.enable = true;
|
||||
# GUI apps come from apt/flatpak, so nix packages don't need host GPU drivers.
|
||||
targets.genericLinux.gpu.enable = false;
|
||||
|
||||
# Things the stock ~/.profile and ~/.bashrc provided that are still needed.
|
||||
# ~/.local/bin: native installers put binaries here.
|
||||
home.sessionPath = [ "$HOME/.local/bin" "$HOME/bin" ];
|
||||
|
||||
programs.zsh = {
|
||||
# Keep ~/.zshrc etc. in $HOME
|
||||
dotDir = config.home.homeDirectory;
|
||||
# Ubuntu's /etc/zsh/zshrc runs compinit; Home Manager runs it again.
|
||||
envExtra = ''
|
||||
skip_global_compinit=1
|
||||
'';
|
||||
# zsh doesn't read /etc/profile, so /etc/profile.d/* (nix-daemon, /snap/bin,
|
||||
# flatpak XDG_DATA_DIRS, vte) would be skipped for login shells.
|
||||
profileExtra = ''
|
||||
emulate sh -c '. /etc/profile'
|
||||
'';
|
||||
};
|
||||
|
||||
# GNOME's gcr-ssh-agent already owns SSH_AUTH_SOCK; don't start another agent.
|
||||
services.ssh-agent.enable = false;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
vscode-fhs
|
||||
];
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
# recursive links each file, so local-only wallpapers can still go in the folder.
|
||||
{ ... }: {
|
||||
home.file."Pictures/Wallpapers" = {
|
||||
source = ../wallpapers;
|
||||
recursive = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page, on
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{ config,
|
||||
lib,
|
||||
pkgs,
|
||||
apple-silicon,
|
||||
ghostty,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
apple-silicon.nixosModules.apple-silicon-support
|
||||
# Sops and other stuff.
|
||||
../common/core
|
||||
../common/optional/yubikey.nix
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
|
||||
# Bluetooth.
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = false;
|
||||
services.blueman.enable = true;
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
networking.hostName = "asahi-nix"; # Define your hostname.
|
||||
networking.wireless = {
|
||||
enable = true;
|
||||
secretsFile = config.sops.secrets."wireless.env".path;
|
||||
networks = {
|
||||
"UG_LivingRoom_5G" = {
|
||||
pskRaw = "ext:home_psk";
|
||||
};
|
||||
"pioneer" = {
|
||||
pskRaw = "ext:woods_pioneer_psk";
|
||||
};
|
||||
"Thruline Coffee Co - GuestWiFi" = {};
|
||||
"Woods WiFi" = {};
|
||||
# Midway Laundry
|
||||
"NETGEARFDD76C-3" = {};
|
||||
};
|
||||
};
|
||||
|
||||
hardware.asahi = {
|
||||
enable = true;
|
||||
setupAsahiSound = true;
|
||||
peripheralFirmwareDirectory = ./firmware;
|
||||
useExperimentalGPUDriver = true;
|
||||
experimentalGPUInstallMode = "overlay";
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
|
||||
# This doesn't seem to be doing anything in hyprland because it configure libinput directly.
|
||||
# I'll leave it here just in case, but doesn't seem necessary.
|
||||
services.libinput = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
users.users.jmug = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
packages = with pkgs; [
|
||||
git
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
programs.zsh.enable = true;
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
|
||||
services.keyd = {
|
||||
enable = true;
|
||||
keyboards.colemakdhm = {
|
||||
ids = [ "05ac:0351:6f083222" ];
|
||||
settings = {
|
||||
main = {
|
||||
e = "f";
|
||||
r = "p";
|
||||
t = "b";
|
||||
y = "j";
|
||||
u = "l";
|
||||
i = "u";
|
||||
o = "y";
|
||||
p = ";";
|
||||
s = "r";
|
||||
d = "s";
|
||||
f = "t";
|
||||
h = "m";
|
||||
j = "n";
|
||||
k = "e";
|
||||
l = "i";
|
||||
";" = "o";
|
||||
v = "d";
|
||||
b = "v";
|
||||
n = "k";
|
||||
m = "h";
|
||||
capslock = "leftcontrol";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
keyd
|
||||
htop
|
||||
# Misc utils
|
||||
ripgrep
|
||||
fzf
|
||||
unzip
|
||||
nautilus
|
||||
# Terminal
|
||||
ghostty.packages.aarch64-linux.default
|
||||
kitty
|
||||
# Theming
|
||||
palenight-theme
|
||||
# Lock screen
|
||||
hyprlock
|
||||
# Idling
|
||||
sway-audio-idle-inhibit
|
||||
];
|
||||
|
||||
fonts = {
|
||||
fontDir.enable = true;
|
||||
packages = with pkgs; [
|
||||
nerd-fonts.bigblue-terminal
|
||||
nerd-fonts.fira-code
|
||||
nerd-fonts.caskaydia-cove
|
||||
];
|
||||
};
|
||||
|
||||
security.pam.services.hyprlock = {};
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
environment.sessionVariables = {
|
||||
# Enable wayland support for chromium/electron apps.
|
||||
GDK_BACKEND = "wayland";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
# This caused issues with walker, but might be some other
|
||||
# issue with wayland/hyprland, so will leave it here for now.
|
||||
# QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
# WLR_NO_HARDWARE_CURSORS = "1";
|
||||
};
|
||||
|
||||
# This is not really enabling X11, bad naming.
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = true;
|
||||
};
|
||||
};
|
||||
# This is used to scale the gdm login screen,
|
||||
# try to set it up for fractional scaling in
|
||||
# the future.
|
||||
home-manager.users.gdm = { lib, ... }: {
|
||||
home.stateVersion = "25.05"; # Do not change!!!
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
scaling-factor = lib.hm.gvariant.mkUint32 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# USB devices.
|
||||
services.devmon.enable = true;
|
||||
services.gvfs.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
|
||||
system.stateVersion = "25.05"; # Don't change!!!
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "usb_storage" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/b5800f37-1df2-4d6c-b2c7-7c274d56e938";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/547D-181B";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/e4138eb3-f8cf-436f-9a0f-3c67d3095582"; }
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
} :
|
||||
let
|
||||
pathToKeys = ../common/keys/yubi;
|
||||
yubiKeys =
|
||||
lib.lists.forEach (builtins.attrNames (builtins.readDir pathToKeys))
|
||||
(key: lib.substring 0 (lib.stringLength key - lib.stringLength ".pub") key); # Remove .pub suffix.
|
||||
yubikeyPublicKeyEntries = lib.attrsets.mergeAttrsList (
|
||||
lib.lists.map
|
||||
(key: { ".ssh/${key}.pub".source = "${pathToKeys}/${key}.pub"; })
|
||||
yubiKeys
|
||||
);
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# TODO: Move all hyprland related config to its own module.
|
||||
../../home-modules/hyprland
|
||||
|
||||
../../home-modules/direnv.nix
|
||||
../../home-modules/ghostty-config.nix
|
||||
../../home-modules/git.nix
|
||||
../../home-modules/lazygit.nix
|
||||
../../home-modules/nvim.nix
|
||||
../../home-modules/sops.nix
|
||||
../../home-modules/ssh-client.nix
|
||||
../../home-modules/starship.nix
|
||||
../../home-modules/tmux.nix
|
||||
../../home-modules/zsh.nix
|
||||
];
|
||||
|
||||
ghostty.font-size = "14";
|
||||
ghostty.window-decoration = false;
|
||||
|
||||
home = {
|
||||
username = "jmug";
|
||||
homeDirectory = "/home/jmug";
|
||||
|
||||
packages = with pkgs; [
|
||||
# Media
|
||||
loupe
|
||||
vlc
|
||||
# Audio
|
||||
wireplumber
|
||||
spotify-player
|
||||
# Screen management
|
||||
brightnessctl
|
||||
# Secret management.
|
||||
age
|
||||
sops
|
||||
# Browsers
|
||||
ungoogled-chromium
|
||||
# Coms
|
||||
(webcord.override { electron = inputs.nixpkgs-electron-32.legacyPackages."aarch64-linux".electron; })
|
||||
whatsie
|
||||
obs-studio
|
||||
# Dev tools
|
||||
flyctl
|
||||
pkgs-unstable.claude-code
|
||||
# AWS tools
|
||||
awscli2
|
||||
(callPackage ../../nixos-modules/shell-apps/aws-cli-mfa.nix {})
|
||||
];
|
||||
|
||||
pointerCursor = {
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
hyprcursor.enable = true;
|
||||
name = "Posy_Cursor_Black";
|
||||
package = pkgs."posy-cursors";
|
||||
};
|
||||
|
||||
file = {} // yubikeyPublicKeyEntries;
|
||||
|
||||
stateVersion = "25.05"; # Do not change!!!
|
||||
};
|
||||
|
||||
home.activation.aws-cli-mfa-config = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
mkdir -p ~/.config/aws-cli-mfa
|
||||
cat > ~/.config/aws-cli-mfa/config.yaml << EOF
|
||||
mfa_serial: $(cat ${config.sops.secrets."aws/jmug_ace_mfa_serial".path})
|
||||
role_arn: $(cat ${config.sops.secrets."aws/role_arn".path})
|
||||
session_duration: 43200
|
||||
EOF
|
||||
'';
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
gtk3 = {
|
||||
extraConfig = {
|
||||
gtk-application-prefer-dark-theme = 1;
|
||||
};
|
||||
};
|
||||
gtk4 = {
|
||||
extraConfig = {
|
||||
gtk-application-prefer-dark-theme = 1;
|
||||
};
|
||||
};
|
||||
theme = {
|
||||
name = "palenight";
|
||||
package = pkgs.palenight-theme;
|
||||
};
|
||||
};
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme = "gtk";
|
||||
};
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
xdg.configFile = {
|
||||
"gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets";
|
||||
"gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css";
|
||||
"gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css";
|
||||
};
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
addKeysToAgent = "yes";
|
||||
matchBlocks = {
|
||||
"git" = {
|
||||
host = "github.com";
|
||||
user = "git";
|
||||
identityFile = [
|
||||
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
||||
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
|
||||
];
|
||||
};
|
||||
"forgejo" = {
|
||||
host = "code.jmug.me";
|
||||
user = "git";
|
||||
identityFile = [
|
||||
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
||||
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
|
||||
];
|
||||
};
|
||||
wsl = {
|
||||
user = "jmug";
|
||||
hostname = "192.168.10.241";
|
||||
port = 69;
|
||||
forwardAgent = true;
|
||||
identityFile = [
|
||||
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
||||
];
|
||||
};
|
||||
ws = {
|
||||
user = "jmug";
|
||||
hostname = "98.59.213.212";
|
||||
port = 69;
|
||||
forwardAgent = true;
|
||||
identityFile = [
|
||||
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
# TODO BEGIN Interpolate the name of the host here.
|
||||
# flakeconf = "sudo nvim /etc/nixos/flake.nix";
|
||||
# nosconf = "sudo nvim /etc/nixos/hosts/devbox/configuration.nix";
|
||||
# homeconf = "sudo nvim /etc/nixos/hosts/devbox/home.nix";
|
||||
# nvconf = "sudo nvim /etc/nixos/home-modules/explicit-configs/nvim/init.lua";
|
||||
# TODO END Interpolate the name of the host here.
|
||||
rshellconf = "source ~/.zshrc";
|
||||
fly = "flyctl";
|
||||
# TODO: Interpolate the name of the host here.
|
||||
nrsw = "sudo nixos-rebuild switch --flake /home/jmug/nixos#asahi"; # parametrize this as home dir.
|
||||
awsmfa = "eval $(aws-cli-mfa)";
|
||||
uawsmfa = "eval $(aws-cli-mfa --unset)";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
@@ -58,7 +58,6 @@ in
|
||||
};
|
||||
|
||||
programs.zsh.enable = true;
|
||||
user.name = "jmug";
|
||||
users.users.jmug = {
|
||||
isNormalUser = true;
|
||||
description = "Mariano Uvalle";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ config, pkgs, homeConfigurationName, ... } :
|
||||
{ config, pkgs, ... } :
|
||||
|
||||
{
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
shellAliases = {
|
||||
lg = "lazygit";
|
||||
n = "nvim";
|
||||
nrsw = "nixos-rebuild switch --flake /etc/nixos#${homeConfigurationName}";
|
||||
# TODO: Interpolate the hostname here.
|
||||
nrsw = "nixos-rebuild switch --flake /etc/nixos#devbox";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
pkgs,
|
||||
ssh-agent-switcher,
|
||||
user,
|
||||
homeConfigurationName,
|
||||
...
|
||||
} :
|
||||
let
|
||||
@@ -100,8 +99,15 @@ EOF
|
||||
|
||||
programs.zsh = {
|
||||
shellAliases = {
|
||||
# TODO BEGIN Interpolate the name of the host here.
|
||||
# flakeconf = "sudo nvim /etc/nixos/flake.nix";
|
||||
# nosconf = "sudo nvim /etc/nixos/hosts/devbox/configuration.nix";
|
||||
# homeconf = "sudo nvim /etc/nixos/hosts/devbox/home.nix";
|
||||
# nvconf = "sudo nvim /etc/nixos/home-modules/explicit-configs/nvim/init.lua";
|
||||
# TODO END Interpolate the name of the host here.
|
||||
rshellconf = "source ~/.zshrc";
|
||||
nrsw = "sudo nixos-rebuild switch --flake ${homeDirectory}/nixos#${homeConfigurationName}";
|
||||
# TODO: Interpolate the name of the host here.
|
||||
nrsw = "sudo nixos-rebuild switch --flake /home/jmug/nixos#devbox";
|
||||
fly = "flyctl";
|
||||
awsmfa = "eval $(aws-cli-mfa)";
|
||||
uawsmfa = "eval $(aws-cli-mfa --unset)";
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
enable = true;
|
||||
onActivation = {
|
||||
autoUpdate = true;
|
||||
# cleanup = "uninstall";
|
||||
cleanup = "uninstall";
|
||||
upgrade = true;
|
||||
};
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
};
|
||||
|
||||
taps = [
|
||||
# "agavra/tap"
|
||||
];
|
||||
brews = [
|
||||
"gh"
|
||||
"watchman"
|
||||
"vite"
|
||||
"pipx"
|
||||
@@ -49,6 +49,7 @@
|
||||
"glow"
|
||||
"chromaprint"
|
||||
"libiconv"
|
||||
# "agavra/tap/tuicr"
|
||||
"automake"
|
||||
"autoconf"
|
||||
"pkg-config"
|
||||
|
||||
+4
-13
@@ -5,7 +5,6 @@
|
||||
opencode-tunneler,
|
||||
godig,
|
||||
user,
|
||||
homeConfigurationName,
|
||||
...
|
||||
} :
|
||||
let
|
||||
@@ -25,7 +24,6 @@ in {
|
||||
../../home-modules/secretive.nix
|
||||
../../home-modules/starship.nix
|
||||
../../home-modules/tmux.nix
|
||||
../../home-modules/herdr.nix
|
||||
../../home-modules/opencode-config.nix
|
||||
../../home-modules/zsh.nix
|
||||
];
|
||||
@@ -118,15 +116,9 @@ in {
|
||||
hostname = "82.180.160.149";
|
||||
forwardAgent = true;
|
||||
};
|
||||
handmade-gitea = {
|
||||
handmaderunner = {
|
||||
user = "jmug";
|
||||
hostname = "40.160.241.66";
|
||||
forwardAgent = true;
|
||||
};
|
||||
handmade-runner = {
|
||||
user = "jmug";
|
||||
hostname = "40.160.151.45";
|
||||
forwardAgent = true;
|
||||
hostname = "2.25.209.218";
|
||||
};
|
||||
racknerd = {
|
||||
user = "jmug";
|
||||
@@ -151,6 +143,7 @@ in {
|
||||
|
||||
programs.zsh = {
|
||||
shellAliases = {
|
||||
# TODO BEGIN Interpolate the name of the host here.
|
||||
flakeconf = "nvim ${homeDirectory}/nixos/flake.nix";
|
||||
sysconf = "nvim ${homeDirectory}/nixos/hosts/macbook/configuration.nix";
|
||||
homeconf = "nvim ${homeDirectory}/nixos/hosts/macbook/home.nix";
|
||||
@@ -158,13 +151,11 @@ in {
|
||||
k = "kubectl";
|
||||
|
||||
rshellconf = "source ${homeDirectory}/.zshrc";
|
||||
nrsw = "sudo darwin-rebuild switch --flake ${homeDirectory}/nixos#${homeConfigurationName}";
|
||||
nrsw = "sudo darwin-rebuild switch --flake ${homeDirectory}/nixos#macbook";
|
||||
opencode-local = "${homeDirectory}/dev/opencode/dist-local/bin/opencode";
|
||||
};
|
||||
|
||||
initContent = ''
|
||||
eval "$(mise activate zsh)"
|
||||
|
||||
export PATH=$PATH:$HOME/bin
|
||||
export PATH=$PATH:$HOME/.opencode/bin
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
pkgs-unstable,
|
||||
ssh-agent-switcher,
|
||||
user,
|
||||
homeConfigurationName,
|
||||
...
|
||||
} :
|
||||
let
|
||||
@@ -124,7 +123,8 @@ in {
|
||||
homeconf = "nvim ${homeDirectory}/nixos/hosts/nixbox/home.nix";
|
||||
nvconf = "sudo nvim ${homeDirectory}/nixos/home-modules/explicit-configs/nvim/init.lua";
|
||||
rshellconf = "source ~/.zshrc";
|
||||
nrsw = "sudo nixos-rebuild switch --flake ${homeDirectory}/nixos#${homeConfigurationName}";
|
||||
# TODO: Interpolate the name of the host here.
|
||||
nrsw = "sudo nixos-rebuild switch --flake ${homeDirectory}/nixos#nixbox";
|
||||
fly = "flyctl";
|
||||
# awsmfa = "eval $(aws-cli-mfa)";
|
||||
# uawsmfa = "eval $(aws-cli-mfa --unset)";
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
# Ubuntu desktop. User config only.
|
||||
# OS packages and /etc files are handled by ../../ubuntu/bootstrap.sh.
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
homeConfigurationName,
|
||||
...
|
||||
} :
|
||||
let
|
||||
homeDirectory = "/home/jmug";
|
||||
in {
|
||||
imports = [
|
||||
../../home-modules/default.nix
|
||||
../../home-modules/ubuntu.nix
|
||||
../../home-modules/direnv.nix
|
||||
../../home-modules/ghostty-config.nix
|
||||
../../home-modules/git.nix
|
||||
../../home-modules/herdr.nix
|
||||
../../home-modules/lazygit.nix
|
||||
../../home-modules/niri
|
||||
../../home-modules/nvim.nix
|
||||
../../home-modules/opencode-config.nix
|
||||
../../home-modules/starship.nix
|
||||
../../home-modules/wallpapers.nix
|
||||
../../home-modules/zsh.nix
|
||||
|
||||
inputs.nix-flatpak.homeManagerModules.nix-flatpak
|
||||
];
|
||||
|
||||
# TODO(yubikey): Port the yubikey setup (sops-managed key handles in ~/.ssh,
|
||||
# id_yubikey symlink via udev, ykman/pcscd from apt, yubikey public keys).
|
||||
# See modules/nixos/yubikey and home-modules/sops.nix.
|
||||
|
||||
nvim = {
|
||||
enable = true;
|
||||
package = pkgs.neovim; # pkgs is already nixpkgs-unstable.
|
||||
};
|
||||
|
||||
ghostty = {
|
||||
font-size = "14";
|
||||
# GNOME needs server-side decorations to move/resize windows.
|
||||
# TODO: Turn off if dropping GNOME for niri.
|
||||
window-decoration = true;
|
||||
};
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home = {
|
||||
username = "jmug";
|
||||
inherit homeDirectory;
|
||||
|
||||
sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
# Fonts (ghostty uses BigBlueTermPlus).
|
||||
nerd-fonts.bigblue-terminal
|
||||
nerd-fonts.fira-code
|
||||
nerd-fonts.caskaydia-cove
|
||||
|
||||
# Languages / toolchains. The C toolchain (gcc, clang, cmake) comes from
|
||||
# apt so native builds link against the system's libraries.
|
||||
bun
|
||||
rustup
|
||||
nodejs_24
|
||||
# eas-cli
|
||||
|
||||
# Cloud / infra.
|
||||
awscli2
|
||||
google-cloud-sdk
|
||||
flyctl
|
||||
ngrok
|
||||
gh
|
||||
|
||||
# Secrets.
|
||||
sops
|
||||
age
|
||||
|
||||
# Serial consoles.
|
||||
minicom
|
||||
picocom
|
||||
tio
|
||||
|
||||
# Misc CLI.
|
||||
opencode
|
||||
glow
|
||||
pipx
|
||||
watchman
|
||||
exercism
|
||||
fastfetch
|
||||
btop
|
||||
tree
|
||||
bluetui
|
||||
];
|
||||
|
||||
stateVersion = "25.11";
|
||||
};
|
||||
|
||||
# Desktop apps. Installed per-user from flathub on activation.
|
||||
services.flatpak = {
|
||||
enable = true;
|
||||
packages = [
|
||||
"app.zen_browser.zen"
|
||||
"com.slack.Slack"
|
||||
"com.obsproject.Studio"
|
||||
"org.videolan.VLC"
|
||||
];
|
||||
};
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
# Keys: ~/.ssh/id_* defaults, served by GNOME's agent.
|
||||
# TODO(yubikey): IdentityFile id_yubikey / id_jmug like hosts/nixbox.
|
||||
settings = {
|
||||
"*" = {
|
||||
AddKeysToAgent = "no";
|
||||
Compression = false;
|
||||
ServerAliveInterval = 0;
|
||||
ServerAliveCountMax = 3;
|
||||
HashKnownHosts = false;
|
||||
UserKnownHostsFile = "~/.ssh/known_hosts";
|
||||
ControlMaster = "no";
|
||||
ControlPath = "~/.ssh/master-%r@%n:%p";
|
||||
ControlPersist = "no";
|
||||
};
|
||||
"github.com" = { User = "git"; AddKeysToAgent = "yes"; };
|
||||
"code.jmug.me" = { User = "git"; AddKeysToAgent = "yes"; };
|
||||
homeserver = { User = "jmug"; HostName = "100.122.244.59"; ForwardAgent = true; };
|
||||
devbox = { User = "jmug"; HostName = "100.102.140.44"; ForwardAgent = true; };
|
||||
handmade = { User = "jmug"; HostName = "82.180.160.149"; ForwardAgent = true; };
|
||||
handmade-gitea = { User = "jmug"; HostName = "40.160.241.66"; ForwardAgent = true; };
|
||||
racknerd = { User = "jmug"; HostName = "155.94.155.137"; AddKeysToAgent = "yes"; ForwardAgent = false; };
|
||||
beefy = { User = "jmug"; HostName = "100.127.115.24"; AddKeysToAgent = "yes"; ForwardAgent = true; };
|
||||
mid = { User = "jmug"; HostName = "100.82.115.89"; AddKeysToAgent = "yes"; ForwardAgent = true; };
|
||||
};
|
||||
};
|
||||
|
||||
programs.zsh.shellAliases = {
|
||||
flakeconf = "nvim ${homeDirectory}/nixos/flake.nix";
|
||||
homeconf = "nvim ${homeDirectory}/nixos/hosts/ubuntu/home.nix";
|
||||
nvconf = "nvim ${homeDirectory}/nixos/home-modules/explicit-configs/nvim/init.lua";
|
||||
rshellconf = "source ${homeDirectory}/.zshrc";
|
||||
# Home Manager only.
|
||||
homesw = "home-manager switch -b hm-backup --flake ${homeDirectory}/nixos#${homeConfigurationName}";
|
||||
# apt packages, repos, /etc files, then Home Manager.
|
||||
syssw = "${homeDirectory}/nixos/ubuntu/bootstrap.sh";
|
||||
};
|
||||
|
||||
# Friendlier names for the built-in SoundWire audio (Intel SOF "sof-soundwire"
|
||||
# card), which otherwise shows up as "sof-soundwire Speaker" etc.
|
||||
# TODO: X1 Carbon Gen 14 specific (harmless elsewhere: rules only match
|
||||
# sof_sdw nodes). Move to a per-machine module when another host lands.
|
||||
xdg.configFile."wireplumber/wireplumber.conf.d/51-builtin-audio-names.conf".text = ''
|
||||
monitor.alsa.rules = [
|
||||
{
|
||||
matches = [ { device.name = "~alsa_card.*sof_sdw.*" } ]
|
||||
actions = { update-props = { device.description = "Built-in Audio", device.nick = "Built-in Audio" } }
|
||||
}
|
||||
{
|
||||
matches = [ { node.name = "~alsa_output.*sof_sdw.*Speaker.*" } ]
|
||||
actions = { update-props = { node.description = "Speakers" } }
|
||||
}
|
||||
{
|
||||
matches = [ { node.name = "~alsa_output.*sof_sdw.*Headphones.*" } ]
|
||||
actions = { update-props = { node.description = "Headphones" } }
|
||||
}
|
||||
{
|
||||
matches = [ { node.name = "~alsa_input.*sof_sdw.*Mic.*" } ]
|
||||
actions = { update-props = { node.description = "Internal Microphones" } }
|
||||
}
|
||||
{
|
||||
matches = [ { node.name = "~alsa_output.*sof_sdw.*HDMI1.*" } ]
|
||||
actions = { update-props = { node.description = "HDMI / DisplayPort 1" } }
|
||||
}
|
||||
{
|
||||
matches = [ { node.name = "~alsa_output.*sof_sdw.*HDMI2.*" } ]
|
||||
actions = { update-props = { node.description = "HDMI / DisplayPort 2" } }
|
||||
}
|
||||
{
|
||||
matches = [ { node.name = "~alsa_output.*sof_sdw.*HDMI3.*" } ]
|
||||
actions = { update-props = { node.description = "HDMI / DisplayPort 3" } }
|
||||
}
|
||||
]
|
||||
'';
|
||||
|
||||
# mise is installed by `ubuntu/bootstrap.sh tools`.
|
||||
programs.zsh.initContent = ''
|
||||
if [ -x "$HOME/.local/bin/mise" ]; then
|
||||
eval "$("$HOME/.local/bin/mise" activate zsh)"
|
||||
fi
|
||||
'';
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs }:
|
||||
pkgs.writeShellApplication {
|
||||
name = "hello";
|
||||
runtimeInputs = with pkgs; [ cowsay lolcat ];
|
||||
text = ''
|
||||
echo "Hello World!" | cowsay | lolcat
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{ pkgs }:
|
||||
pkgs.writeShellApplication {
|
||||
name = "print-colors";
|
||||
text = ''
|
||||
printf "|039| \033[39mDefault \033[m |049| \033[49mDefault \033[m |037| \033[37mLight gray \033[m |047| \033[47mLight gray \033[m\n"
|
||||
printf "|030| \033[30mBlack \033[m |040| \033[40mBlack \033[m |090| \033[90mDark gray \033[m |100| \033[100mDark gray \033[m\n"
|
||||
printf "|031| \033[31mRed \033[m |041| \033[41mRed \033[m |091| \033[91mLight red \033[m |101| \033[101mLight red \033[m\n"
|
||||
printf "|032| \033[32mGreen \033[m |042| \033[42mGreen \033[m |092| \033[92mLight green \033[m |102| \033[102mLight green \033[m\n"
|
||||
printf "|033| \033[33mYellow \033[m |043| \033[43mYellow \033[m |093| \033[93mLight yellow \033[m |103| \033[103mLight yellow \033[m\n"
|
||||
printf "|034| \033[34mBlue \033[m |044| \033[44mBlue \033[m |094| \033[94mLight blue \033[m |104| \033[104mLight blue \033[m\n"
|
||||
printf "|035| \033[35mMagenta \033[m |045| \033[45mMagenta \033[m |095| \033[95mLight magenta \033[m |105| \033[105mLight magenta \033[m\n"
|
||||
printf "|036| \033[36mCyan \033[m |046| \033[46mCyan \033[m |096| \033[96mLight cyan \033[m |106| \033[106mLight cyan \033[m\n"
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
# Ubuntu machines
|
||||
|
||||
Ubuntu machines are managed in layers:
|
||||
|
||||
| Layer | Where | Applied by |
|
||||
|---|---|---|
|
||||
| User env: CLI tools, dotfiles, fonts, ssh hosts | `hosts/ubuntu/home.nix` | Home Manager |
|
||||
| Desktop apps (flatpak) | `services.flatpak` in `hosts/ubuntu/home.nix` | nix-flatpak, on HM activation |
|
||||
| OS packages | `apt-packages.txt` | `bootstrap.sh` |
|
||||
| Third-party apt repos (tailscale, Dux Labs PPA for niri, Noctalia) | `bootstrap.sh` | `bootstrap.sh` |
|
||||
| niri + Noctalia config | `home-modules/niri` | Home Manager (validated at build time) |
|
||||
| System config files | `etc/**`, mirrored into `/etc` | `bootstrap.sh` |
|
||||
| Self-updating tools from upstream installers (mise, herdr, tuicr) into `~/.local/bin` | `bootstrap.sh` | `bootstrap.sh tools` (kept up to date with update commands) |
|
||||
|
||||
## Fresh machine
|
||||
|
||||
```sh
|
||||
sudo apt install -y git curl
|
||||
git clone <this repo> ~/nixos
|
||||
~/nixos/ubuntu/bootstrap.sh
|
||||
sudo tailscale up
|
||||
# log out and back in
|
||||
```
|
||||
|
||||
After that:
|
||||
|
||||
- `homesw`: Home Manager only.
|
||||
- `syssw`: everything (same as running `bootstrap.sh`).
|
||||
|
||||
## Keyboard (keyd)
|
||||
|
||||
`etc/keyd/default.conf` applies to every keyboard except YubiKeys. The
|
||||
IQUNIX MG75 (`etc/keyd/iqunix.conf`) skips the Alt/Meta swap; the Glove80
|
||||
(`etc/keyd/glove80.conf`) keeps only the meta layer:
|
||||
|
||||
- Caps Lock and Left Control are swapped.
|
||||
- Left Alt and Left Meta are swapped, so the key next to space is Meta.
|
||||
- Meta+C, Meta+V and Meta+X copy, paste and cut. keyd sends Ctrl+Insert,
|
||||
Shift+Insert and Ctrl+X, the same as omarchy's Hyprland binds. These work
|
||||
in GTK/Qt apps, browsers and Electron. Ghostty gets the matching bindings
|
||||
in `home-modules/ghostty-config.nix`.
|
||||
- Meta+Left/Right become Home/End, macOS-style. Niri's Mod+arrow binds
|
||||
never fire as a result; use Mod+H/J/K/L.
|
||||
|
||||
To test keyd: `sudo keyd.rvaiya monitor`. To bypass a broken config: press Backspace+Escape+Enter together, which kills keyd.
|
||||
|
||||
## Desktop (niri + Noctalia)
|
||||
|
||||
GNOME stays installed. Pick **Niri** or **Ubuntu** in the GDM session menu
|
||||
(gear icon on the password screen).
|
||||
|
||||
- niri comes from `ppa:duxlabs/dux-repo`, pinned so the PPA's other packages
|
||||
don't replace Ubuntu's. Noctalia (bar, launcher, lock, idle, wallpaper)
|
||||
comes from `pkg.noctalia.dev`.
|
||||
- Config: `home-modules/niri/config.kdl` and `home-modules/niri/noctalia.toml`.
|
||||
`homesw` fails if either doesn't validate.
|
||||
- Noctalia's settings UI writes to `~/.local/state/noctalia/settings.toml`,
|
||||
which overrides `noctalia.toml`. Copy the keepers into the repo.
|
||||
- Because of keyd, Mod+C/V/X never reach niri: center is on Mod+Backslash and
|
||||
floating is on Mod+P. Mod+Shift+/ lists the binds.
|
||||
- Closing the lid suspends only on battery, so a Bluetooth keyboard or mouse
|
||||
can wake the screens while docked.
|
||||
|
||||
## TODO
|
||||
|
||||
- [ ] **YubiKey**: port `modules/nixos/yubikey` and `home-modules/sops.nix`. ykman and pcscd from apt, the udev rule plus yubikey-up/down scripts in `etc/`, the sops age key from cold storage, and the `id_yubikey` identity files in the ssh config.
|
||||
- [ ] **system-manager**: explore [numtide/system-manager](https://github.com/numtide/system-manager) to move `etc/` and the systemd service setup into Nix.
|
||||
@@ -1,30 +0,0 @@
|
||||
# Installed by bootstrap.sh. One package per line, # for comments.
|
||||
|
||||
# Shell:
|
||||
zsh
|
||||
|
||||
# Desktop:
|
||||
flatpak
|
||||
ghostty
|
||||
wl-clipboard
|
||||
niri # Dux Labs PPA.
|
||||
noctalia
|
||||
|
||||
# Input:
|
||||
keyd
|
||||
logiops
|
||||
|
||||
# Containers:
|
||||
docker.io
|
||||
docker-buildx
|
||||
docker-compose-v2
|
||||
|
||||
# C toolchain:
|
||||
build-essential
|
||||
clang
|
||||
clangd
|
||||
cmake
|
||||
pkg-config
|
||||
|
||||
# Out-of-tree kernel modules:
|
||||
dkms
|
||||
@@ -1,223 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Bootstrap / sync an Ubuntu machine from this repo. Idempotent: re-run it
|
||||
# whenever apt-packages.txt, ubuntu/etc/**, or the Home Manager config change.
|
||||
set -euo pipefail
|
||||
|
||||
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
HERE="$REPO/ubuntu"
|
||||
HM_TARGET="${HM_TARGET:-ubuntu}"
|
||||
ALL_STEPS=(nix repos apt etc services shell tools home)
|
||||
|
||||
# Tools installed with their upstream install script instead of Nix/apt.
|
||||
TOOLS=(
|
||||
"mise|https://mise.run"
|
||||
"herdr|https://herdr.dev/install.sh"
|
||||
"tuicr|https://tuicr.dev/install.sh"
|
||||
)
|
||||
|
||||
log() { printf '\n\033[1;34m==> %s\033[0m\n' "$*"; }
|
||||
info() { printf ' %s\n' "$*"; }
|
||||
|
||||
# Strip comments/blank lines from a list file.
|
||||
read_list() { sed -e 's/#.*//' -e 's/[[:space:]]*$//' -e '/^$/d' "$1"; }
|
||||
|
||||
step_nix() {
|
||||
log "nix"
|
||||
if command -v nix >/dev/null 2>&1; then
|
||||
info "already installed: $(nix --version)"
|
||||
return
|
||||
fi
|
||||
# Determinate's installer, but upstream Nix (makes it easier to uninstall if needed).
|
||||
curl -fsSL https://install.determinate.systems/nix \
|
||||
| sh -s -- install --no-confirm --prefer-upstream-nix
|
||||
# shellcheck disable=SC1091
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
}
|
||||
|
||||
step_repos() {
|
||||
log "third-party apt repos"
|
||||
local codename changed=0
|
||||
# shellcheck disable=SC1091
|
||||
codename="$(. /etc/os-release && echo "$VERSION_CODENAME")"
|
||||
|
||||
# Tailscale: https://tailscale.com/kb/1031/install-linux
|
||||
if [ ! -f /etc/apt/sources.list.d/tailscale.list ]; then
|
||||
curl -fsSL "https://pkgs.tailscale.com/stable/ubuntu/${codename}.noarmor.gpg" \
|
||||
| sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
|
||||
curl -fsSL "https://pkgs.tailscale.com/stable/ubuntu/${codename}.tailscale-keyring.list" \
|
||||
| sudo tee /etc/apt/sources.list.d/tailscale.list >/dev/null
|
||||
changed=1
|
||||
fi
|
||||
info "tailscale repo present"
|
||||
|
||||
# Dux Labs PPA, for niri: https://duxlabs.dev/docs/repo
|
||||
# The pin has to be in place before the first apt-get update.
|
||||
local pin=apt/preferences.d/duxlabs-dux-repo
|
||||
if ! sudo cmp -s "$HERE/etc/$pin" "/etc/$pin"; then
|
||||
sudo install -D -m 0644 -o root -g root "$HERE/etc/$pin" "/etc/$pin"
|
||||
changed=1
|
||||
fi
|
||||
if ! compgen -G "/etc/apt/sources.list.d/duxlabs-ubuntu-dux-repo-*" >/dev/null; then
|
||||
sudo add-apt-repository -y -n ppa:duxlabs/dux-repo
|
||||
changed=1
|
||||
fi
|
||||
info "dux labs ppa present (pinned to niri, xwayland-satellite)"
|
||||
|
||||
# Noctalia: https://docs.noctalia.dev/noctalia/getting-started/installation/#debian
|
||||
# The keyring is a package in the repo, so apt keeps it current.
|
||||
if [ ! -f /usr/share/keyrings/nickh-archive-keyring.gpg ]; then
|
||||
local tmp
|
||||
tmp="$(mktemp -d)"
|
||||
curl -fsSL -o "$tmp/nickh-archive-keyring.deb" https://pkg.noctalia.dev/deb/nickh-archive-keyring.deb
|
||||
sudo dpkg -i "$tmp/nickh-archive-keyring.deb"
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
if [ ! -f "/etc/apt/sources.list.d/noctalia-${codename}.sources" ]; then
|
||||
curl -fsSL "https://pkg.noctalia.dev/deb/noctalia-${codename}.sources" \
|
||||
| sudo tee "/etc/apt/sources.list.d/noctalia-${codename}.sources" >/dev/null
|
||||
changed=1
|
||||
fi
|
||||
info "noctalia repo present"
|
||||
|
||||
if [ "$changed" = 1 ]; then sudo apt-get update; fi
|
||||
}
|
||||
|
||||
step_apt() {
|
||||
log "apt packages"
|
||||
local pkgs=() missing=() p
|
||||
mapfile -t pkgs < <(read_list "$HERE/apt-packages.txt")
|
||||
pkgs+=(tailscale) # From step_repos.
|
||||
for p in "${pkgs[@]}"; do
|
||||
dpkg-query -W -f='${Status}' "$p" 2>/dev/null | grep -q 'install ok installed' \
|
||||
|| missing+=("$p")
|
||||
done
|
||||
if [ ${#missing[@]} -eq 0 ]; then
|
||||
info "all ${#pkgs[@]} packages installed"
|
||||
return
|
||||
fi
|
||||
info "installing: ${missing[*]}"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y "${missing[@]}"
|
||||
}
|
||||
|
||||
# Copy ubuntu/etc/** to /etc. Only touches files that differ, and reloads the
|
||||
# daemons whose config changed. Removed files are orphaned.
|
||||
step_etc() {
|
||||
log "/etc files"
|
||||
local src rel dst changed=()
|
||||
while IFS= read -r -d '' src; do
|
||||
rel="${src#"$HERE/etc/"}"
|
||||
dst="/etc/$rel"
|
||||
if sudo cmp -s "$src" "$dst"; then
|
||||
info "unchanged $dst"
|
||||
continue
|
||||
fi
|
||||
if sudo test -e "$dst"; then
|
||||
sudo diff -u "$dst" "$src" || true
|
||||
fi
|
||||
sudo install -D -m 0644 -o root -g root "$src" "$dst"
|
||||
info "updated $dst"
|
||||
changed+=("$rel")
|
||||
done < <(find "$HERE/etc" -type f -print0 | sort -z)
|
||||
|
||||
local rel_changed
|
||||
for rel_changed in "${changed[@]}"; do
|
||||
case "$rel_changed" in
|
||||
keyd/*)
|
||||
# (Ubuntu ships the CLI as keyd.rvaiya)
|
||||
if systemctl is-active -q keyd.service; then sudo systemctl restart keyd.service && info "restarted keyd"; fi ;;
|
||||
logid.cfg)
|
||||
if systemctl is-active -q logid.service; then sudo systemctl restart logid.service && info "restarted logid"; fi ;;
|
||||
systemd/logind.conf.d/*)
|
||||
sudo systemctl reload systemd-logind.service && info "reloaded logind" ;;
|
||||
udev/rules.d/*)
|
||||
sudo udevadm control --reload-rules && sudo udevadm trigger --action=change && info "reloaded udev rules" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
step_services() {
|
||||
log "system services"
|
||||
local unit
|
||||
for unit in keyd.service logid.service docker.service tailscaled.service; do
|
||||
if ! systemctl cat "$unit" >/dev/null 2>&1; then
|
||||
info "skip $unit (not installed)"
|
||||
continue
|
||||
fi
|
||||
if ! systemctl is-enabled -q "$unit" 2>/dev/null || ! systemctl is-active -q "$unit"; then
|
||||
sudo systemctl enable --now "$unit"
|
||||
fi
|
||||
info "running $unit"
|
||||
done
|
||||
|
||||
# dialout: serial ports (ttyUSB/ttyACM).
|
||||
local group
|
||||
for group in docker dialout; do
|
||||
if getent group "$group" >/dev/null && ! id -nG "$USER" | grep -qw "$group"; then
|
||||
sudo usermod -aG "$group" "$USER"
|
||||
info "added $USER to $group group (log out/in to apply)"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
step_shell() {
|
||||
log "login shell"
|
||||
local want=/usr/bin/zsh current
|
||||
current="$(getent passwd "$USER" | cut -d: -f7)"
|
||||
if [ "$current" = "$want" ]; then
|
||||
info "already $want"
|
||||
return
|
||||
fi
|
||||
sudo chsh -s "$want" "$USER"
|
||||
info "changed $current -> $want (log out/in to apply)"
|
||||
}
|
||||
|
||||
step_tools() {
|
||||
log "self-installing tools (~/.local/bin)"
|
||||
local entry name url
|
||||
for entry in "${TOOLS[@]}"; do
|
||||
IFS='|' read -r name url <<<"$entry"
|
||||
# Also check ~/.local/bin directly: on a fresh machine this script may run from a shell that doesn't have it on PATH yet.
|
||||
if command -v "$name" >/dev/null 2>&1 || [ -x "$HOME/.local/bin/$name" ]; then
|
||||
info "already installed: $name"
|
||||
continue
|
||||
fi
|
||||
info "installing $name from $url"
|
||||
# TUICR_INSTALL_YES skips tuicr's confirmation prompt.
|
||||
curl -fsSL "$url" | TUICR_INSTALL_YES=1 sh
|
||||
done
|
||||
}
|
||||
|
||||
step_home() {
|
||||
log "home-manager ($HM_TARGET)"
|
||||
local out
|
||||
out="$(nix build --no-link --print-out-paths "$REPO#homeConfigurations.$HM_TARGET.activationPackage")"
|
||||
HOME_MANAGER_BACKUP_EXT=hm-backup "$out/activate"
|
||||
|
||||
if flatpak info --user app.zen_browser.zen >/dev/null 2>&1 \
|
||||
&& flatpak info --system app.zen_browser.zen >/dev/null 2>&1; then
|
||||
sudo flatpak uninstall --system -y --noninteractive app.zen_browser.zen
|
||||
info "removed system-wide Zen (user install takes over)"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
local steps=("$@") s
|
||||
[ ${#steps[@]} -eq 0 ] && steps=("${ALL_STEPS[@]}")
|
||||
for s in "${steps[@]}"; do
|
||||
if ! declare -F "step_$s" >/dev/null; then
|
||||
echo "unknown step: $s (valid: ${ALL_STEPS[*]})" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for s in "${steps[@]}"; do "step_$s"; done
|
||||
|
||||
log "done"
|
||||
cat <<'EOF'
|
||||
First run only:
|
||||
- sudo tailscale up
|
||||
- log out and back in (zsh login shell, docker group, keyd is live already)
|
||||
EOF
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,10 +0,0 @@
|
||||
# Managed by ~/nixos/ubuntu (bootstrap.sh repos/etc). Local edits get overwritten.
|
||||
# Only niri and xwayland-satellite come from the Dux Labs PPA.
|
||||
# apt uses the first matching record, so the specific one goes first.
|
||||
Package: niri xwayland-satellite
|
||||
Pin: release o=LP-PPA-duxlabs-dux-repo
|
||||
Pin-Priority: 500
|
||||
|
||||
Package: *
|
||||
Pin: release o=LP-PPA-duxlabs-dux-repo
|
||||
Pin-Priority: 1
|
||||
@@ -1,26 +0,0 @@
|
||||
# Managed by ~/nixos/ubuntu (bootstrap.sh etc). Local edits get overwritten.
|
||||
[ids]
|
||||
*
|
||||
# YubiKey enumerates as a keyboard, ignore it.
|
||||
-1050:0407
|
||||
# logid's virtual keyboard.
|
||||
-0000:0000:48cf0dd2
|
||||
|
||||
[main]
|
||||
# Caps Lock <-> Left Control.
|
||||
capslock = layer(control)
|
||||
leftcontrol = capslock
|
||||
# Left Alt <-> Left Meta.
|
||||
leftalt = layer(meta)
|
||||
leftmeta = layer(alt)
|
||||
|
||||
# macOS-style clipboard, same mapping as omarchy's Hyprland binds
|
||||
# (default/hypr/bindings/clipboard.conf), done in keyd instead.
|
||||
# Ctrl/Shift+Insert copy/paste in GTK, Qt, browsers, Electron, and terminals.
|
||||
[meta]
|
||||
c = C-insert
|
||||
v = S-insert
|
||||
x = C-x
|
||||
# Meta+Left/Right = Home/End, macOS-style.
|
||||
left = home
|
||||
right = end
|
||||
@@ -1,14 +0,0 @@
|
||||
# Managed by ~/nixos/ubuntu (bootstrap.sh etc). Local edits get overwritten.
|
||||
# Glove80 over Bluetooth; docked over USB it enumerates with a different id.
|
||||
# The layout lives in the board's ZMK firmware, so of default.conf keep
|
||||
# only the meta layer.
|
||||
[ids]
|
||||
16c0:27db
|
||||
|
||||
# macOS-style clipboard and line navigation, see default.conf.
|
||||
[meta]
|
||||
c = C-insert
|
||||
v = S-insert
|
||||
x = C-x
|
||||
left = home
|
||||
right = end
|
||||
@@ -1,19 +0,0 @@
|
||||
# Managed by ~/nixos/ubuntu (bootstrap.sh etc). Local edits get overwritten.
|
||||
# IQUNIX MG75. Same as default.conf minus the Alt/Meta swap: the board
|
||||
# already has Meta next to space. An explicit ID beats the * in default.conf.
|
||||
[ids]
|
||||
245a:8276
|
||||
|
||||
[main]
|
||||
# Caps Lock <-> Left Control.
|
||||
capslock = layer(control)
|
||||
leftcontrol = capslock
|
||||
|
||||
# macOS-style clipboard, see default.conf.
|
||||
[meta]
|
||||
c = C-insert
|
||||
v = S-insert
|
||||
x = C-x
|
||||
# Meta+Left/Right = Home/End, see default.conf.
|
||||
left = home
|
||||
right = end
|
||||
@@ -1,104 +0,0 @@
|
||||
// Managed by ~/nixos/ubuntu (bootstrap.sh etc). Local edits get overwritten.
|
||||
// Ported from hosts/nixbox/configuration.nix.
|
||||
|
||||
// The 500 ms default is too short for the MX Master 4 reconnecting after a wake.
|
||||
io_timeout: 3000.0;
|
||||
|
||||
devices: (
|
||||
{
|
||||
name: "MX Master 4";
|
||||
|
||||
// Matches the kernel's hi-res wheel multiplier; otherwise each notch
|
||||
// scrolls a fraction of a line.
|
||||
hiresscroll: {
|
||||
hires: true;
|
||||
invert: false;
|
||||
target: false;
|
||||
};
|
||||
|
||||
// Thumb buttons send Super+Page_Up/Page_Down: switch workspaces in GNOME and niri.
|
||||
buttons: (
|
||||
{
|
||||
cid: 0x53;
|
||||
action =
|
||||
{
|
||||
type : "Keypress";
|
||||
keys: ["KEY_LEFTMETA", "KEY_PAGEUP"];
|
||||
};
|
||||
},
|
||||
{
|
||||
cid: 0x56;
|
||||
action =
|
||||
{
|
||||
type : "Keypress";
|
||||
keys: ["KEY_LEFTMETA", "KEY_PAGEDOWN"];
|
||||
};
|
||||
}
|
||||
);
|
||||
},
|
||||
{
|
||||
name: "Wireless Mouse MX Master 3";
|
||||
|
||||
hiresscroll: {
|
||||
};
|
||||
|
||||
thumbwheel: {
|
||||
invert: true;
|
||||
};
|
||||
|
||||
buttons: (
|
||||
{
|
||||
cid: 0x53;
|
||||
action =
|
||||
{
|
||||
type : "Keypress";
|
||||
keys: ["KEY_LEFTMETA", "KEY_LEFT"];
|
||||
};
|
||||
},
|
||||
{
|
||||
cid: 0x56;
|
||||
action =
|
||||
{
|
||||
type : "Keypress";
|
||||
keys: ["KEY_LEFTMETA", "KEY_RIGHT"];
|
||||
};
|
||||
}
|
||||
);
|
||||
},
|
||||
{
|
||||
name: "MX Vertical Advanced Ergonomic Mouse";
|
||||
|
||||
hiresscroll: {
|
||||
hires: true;
|
||||
invert: false;
|
||||
target: false;
|
||||
};
|
||||
|
||||
buttons: (
|
||||
{
|
||||
cid: 0x53;
|
||||
action =
|
||||
{
|
||||
type : "Keypress";
|
||||
keys: ["KEY_LEFTMETA", "KEY_PAGEUP"];
|
||||
};
|
||||
},
|
||||
{
|
||||
cid: 0x56;
|
||||
action =
|
||||
{
|
||||
type : "Keypress";
|
||||
keys: ["KEY_LEFTMETA", "KEY_PAGEDOWN"];
|
||||
};
|
||||
},
|
||||
{
|
||||
cid: 0xfd;
|
||||
action =
|
||||
{
|
||||
type : "Keypress";
|
||||
keys: ["KEY_LEFTMETA"];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -1,6 +0,0 @@
|
||||
# Managed by ~/nixos/ubuntu (bootstrap.sh etc). Local edits get overwritten.
|
||||
# Lid closed only suspends on battery, so Bluetooth input can wake the screens
|
||||
# while docked. HandleLidSwitchDocked isn't enough: the USB-C monitor
|
||||
# disconnects when niri powers it off, and logind stops counting it as a dock.
|
||||
[Login]
|
||||
HandleLidSwitchExternalPower=ignore
|
||||
@@ -1,11 +0,0 @@
|
||||
# Managed by ~/nixos/ubuntu (bootstrap.sh etc). Local edits get overwritten.
|
||||
# Dev boards/probes without root: uaccess (logged-in user), plugdev (ssh).
|
||||
# Must sort before 73-seat-late.rules or uaccess is ignored.
|
||||
|
||||
# Raspberry Pi: Debug Probe, Picoprobe, RP2040/RP2350 BOOTSEL.
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="2e8a", MODE="0664", GROUP="plugdev", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="2e8a", MODE="0664", GROUP="plugdev", TAG+="uaccess"
|
||||
|
||||
# FTDI: ULX3S, JTAG programmers; hidraw for FT260.
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", MODE="0664", GROUP="plugdev", TAG+="uaccess"
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="0403", MODE="0664", GROUP="plugdev", TAG+="uaccess"
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
homeConfigurationName,
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
...
|
||||
@@ -13,7 +12,6 @@
|
||||
../../home-modules/direnv.nix
|
||||
../../home-modules/zsh.nix
|
||||
../../home-modules/tmux.nix
|
||||
../../home-modules/herdr.nix
|
||||
];
|
||||
|
||||
nvim = {
|
||||
@@ -24,14 +22,13 @@
|
||||
home = {
|
||||
username = "jmug";
|
||||
homeDirectory = "/home/jmug";
|
||||
sessionPath = [ "$HOME/.local/bin" ];
|
||||
|
||||
stateVersion = "25.05";
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
shellAliases = {
|
||||
homesw = "home-manager --flake /home/jmug/nixos#${homeConfigurationName} --extra-experimental-features nix-command --extra-experimental-features flakes switch";
|
||||
homesw = "home-manager --flake /home/jmug/nixos#devbox --extra-experimental-features nix-command --extra-experimental-features flakes switch";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.7 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.6 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.7 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 MiB |
Reference in New Issue
Block a user