Skip to content

Commit 8ef8918

Browse files
committed
nix: sunday refactor to use blueprint
1 parent a6e42c4 commit 8ef8918

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+283
-234
lines changed

flake.lock

Lines changed: 38 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 6 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
inputs = {
55
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
blueprint = {
7+
url = "github:numtide/blueprint";
8+
inputs.nixpkgs.follows = "nixpkgs";
9+
};
610
home-manager = {
711
url = "github:nix-community/home-manager";
812
inputs.nixpkgs.follows = "nixpkgs";
@@ -16,6 +20,7 @@
1620
inputs.nixpkgs.follows = "nixpkgs";
1721
};
1822
impermanence.url = "github:nix-community/impermanence";
23+
1924
# neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
2025
helix.url = "github:helix-editor/helix";
2126

@@ -33,182 +38,5 @@
3338
# gridx.url = "path:/home/danieln/code/gridx";
3439
};
3540

36-
outputs = inputs @ {nixpkgs, ...}: {
37-
formatter = {
38-
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
39-
};
40-
41-
nixosConfigurations = {
42-
simmons = nixpkgs.lib.nixosSystem {
43-
system = "x86_64-linux";
44-
specialArgs = {
45-
inherit inputs;
46-
hostname = "simmons";
47-
};
48-
modules = [
49-
./hosts/common
50-
./hosts/common/laptops.nix
51-
./hosts/simmons
52-
];
53-
};
54-
55-
lusus = nixpkgs.lib.nixosSystem {
56-
system = "x86_64-linux";
57-
specialArgs = {
58-
inherit inputs;
59-
hostname = "lusus";
60-
};
61-
modules = [
62-
./hosts/common
63-
./hosts/common/laptops.nix
64-
./hosts/lusus
65-
({...}: {
66-
nixpkgs.overlays = [
67-
# (final: prev: {
68-
# gopls = prev.gopls.overrideAttrs (oldAttrs: {
69-
# version = "95aad07923cb9d64eb951e4512c9e62bc3b8e275";
70-
# src = final.fetchFromGitHub {
71-
# owner = "golang";
72-
# repo = "tools";
73-
# rev = "95aad07923cb9d64eb951e4512c9e62bc3b8e275";
74-
# sha256 = "sha256-8BJ0bBOV6bK40ymTDAXRW09kGjDYHD+fcDIiCJrj0gk=";
75-
# };
76-
# vendorHash = "sha256-z/8LzfbddCkCaK/YXpW3zdY8LteN24Wyg+wBNfTzTK4=";
77-
# buildInputs = (oldAttrs.buildInputs or []) ++ [final.go];
78-
# });
79-
# })
80-
];
81-
home-manager.users.danieln = {
82-
imports = [
83-
inputs.gridx.home-module
84-
];
85-
};
86-
})
87-
];
88-
};
89-
90-
hyperion = nixpkgs.lib.nixosSystem {
91-
system = "x86_64-linux";
92-
specialArgs = {
93-
inherit inputs;
94-
hostname = "hyperion";
95-
};
96-
modules = [
97-
./hosts/common
98-
./hosts/common/servers.nix
99-
./hosts/hyperion
100-
];
101-
};
102-
};
103-
104-
packages.x86_64-linux.nvim = let
105-
pkgs = nixpkgs.legacyPackages.x86_64-linux;
106-
treesitterParsers = pkgs.symlinkJoin {
107-
name = "treesitter-parsers";
108-
paths = pkgs.vimPlugins.nvim-treesitter.withAllGrammars.dependencies;
109-
};
110-
in
111-
pkgs.symlinkJoin {
112-
name = "nvim";
113-
buildInputs = [pkgs.makeWrapper];
114-
paths = [
115-
home/nvim
116-
];
117-
postBuild = ''
118-
mkdir -p $out/bin $out/config/nvim $out/local/nvim/{nixpkgs,lazy}
119-
120-
cat >$out/config/nvim/init.lua <<EOL
121-
local root = vim.fn.fnamemodify("/tmp/debugloop-nvim", ":p")
122-
for _, name in ipairs({ "data", "state", "cache" }) do
123-
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
124-
end
125-
126-
require("aucmd")
127-
require("options")
128-
require("maps")
129-
require("lsp")
130-
131-
NIXPLUG_PATH = "$out" .. "/local/nvim/nixpkgs"
132-
133-
local lazypath = NIXPLUG_PATH .. "/lazy-nvim"
134-
vim.opt.rtp:prepend(lazypath)
135-
136-
require("lazy").setup({
137-
lockfile = root .. "/lazy-lock.json",
138-
spec = {
139-
{ import = "plugins" },
140-
},
141-
defaults = {
142-
lazy = true,
143-
},
144-
change_detection = {
145-
enabled = false,
146-
},
147-
performance = {
148-
rtp = {
149-
disabled_plugins = {
150-
"gzip",
151-
"matchit",
152-
"matchparen",
153-
"netrwPlugin",
154-
"tarPlugin",
155-
"tohtml",
156-
"tutor",
157-
"zipPlugin",
158-
},
159-
},
160-
},
161-
})
162-
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Manage plugins" })
163-
EOL
164-
165-
# all other config
166-
cp -r $out/{lua,ftplugin,after} ${treesitterParsers}/parser $out/config/nvim/
167-
168-
cp -r ${pkgs.vimPlugins.blink-cmp} $out/local/nvim/nixpkgs/blink-cmp
169-
cp -r ${pkgs.vimPlugins.conform-nvim} $out/local/nvim/nixpkgs/conform-nvim
170-
cp -r ${pkgs.vimPlugins.diffview-nvim} $out/local/nvim/nixpkgs/diffview-nvim
171-
cp -r ${pkgs.vimPlugins.friendly-snippets} $out/local/nvim/nixpkgs/friendly-snippets
172-
cp -r ${pkgs.vimPlugins.kanagawa-nvim} $out/local/nvim/nixpkgs/kanagawa-nvim
173-
cp -r ${pkgs.vimPlugins.kulala-nvim} $out/local/nvim/nixpkgs/kulala-nvim
174-
cp -r ${pkgs.vimPlugins.lazy-nvim} $out/local/nvim/nixpkgs/lazy-nvim
175-
cp -r ${pkgs.vimPlugins.lazydev-nvim} $out/local/nvim/nixpkgs/lazydev-nvim
176-
cp -r ${pkgs.vimPlugins.noice-nvim} $out/local/nvim/nixpkgs/noice-nvim
177-
cp -r ${pkgs.vimPlugins.nui-nvim} $out/local/nvim/nixpkgs/nui-nvim
178-
cp -r ${pkgs.vimPlugins.nvim-dap} $out/local/nvim/nixpkgs/nvim-dap
179-
cp -r ${pkgs.vimPlugins.nvim-impairative} $out/local/nvim/nixpkgs/nvim-impairative
180-
cp -r ${pkgs.vimPlugins.nvim-lint} $out/local/nvim/nixpkgs/nvim-lint
181-
cp -r ${pkgs.vimPlugins.nvim-tree-lua} $out/local/nvim/nixpkgs/nvim-tree-lua
182-
cp -r ${pkgs.vimPlugins.nvim-treesitter} $out/local/nvim/nixpkgs/nvim-treesitter
183-
cp -r ${pkgs.vimPlugins.nvim-treesitter-context} $out/local/nvim/nixpkgs/nvim-treesitter-context
184-
cp -r ${pkgs.vimPlugins.nvim-treesitter-textobjects} $out/local/nvim/nixpkgs/nvim-treesitter-textobjects
185-
cp -r ${pkgs.vimPlugins.render-markdown-nvim} $out/local/nvim/nixpkgs/render-markdown-nvim
186-
cp -r ${pkgs.vimPlugins.snacks-nvim} $out/local/nvim/nixpkgs/snacks-nvim
187-
188-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-ai
189-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-bracketed
190-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-bufremove
191-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-clue
192-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-diff
193-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-extra
194-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-files
195-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-git
196-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-hipatterns
197-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-icons
198-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-indentscope
199-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-jump
200-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-operators
201-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-pairs
202-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-pick
203-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-splitjoin
204-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-statusline
205-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-surround
206-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-tabline
207-
cp -r ${pkgs.vimPlugins.mini-nvim} $out/local/nvim/nixpkgs/mini-visits
208-
209-
cp ${pkgs.neovim}/bin/nvim $out/bin/nvim
210-
wrapProgram $out/bin/nvim --set XDG_CONFIG_HOME $out/config
211-
'';
212-
};
213-
};
41+
outputs = inputs: inputs.blueprint {inherit inputs;};
21442
}

hosts/hyperion/configuration.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{flake, ...}: {
2+
imports = [
3+
./boot.nix
4+
flake.nixosModules.common
5+
flake.nixosModules.servers
6+
flake.nixosModules.service-caddy
7+
flake.nixosModules.service-factorio
8+
flake.nixosModules.service-grafana
9+
flake.nixosModules.service-grocy
10+
flake.nixosModules.service-matrix
11+
flake.nixosModules.service-miniflux
12+
flake.nixosModules.service-prometheus
13+
flake.nixosModules.service-restic-rest
14+
];
15+
}

hosts/hyperion/default.nix

Lines changed: 0 additions & 13 deletions
This file was deleted.

hosts/hyperion/lusus/boot.nix

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
modulesPath,
6+
...
7+
}: {
8+
imports = [
9+
(modulesPath + "/installer/scan/not-detected.nix")
10+
];
11+
12+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
13+
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
14+
15+
fileSystems = {
16+
"/nix" = {
17+
device = "/dev/disk/by-uuid/2bbe58f6-c736-4207-8646-05b07fd024f4";
18+
fsType = "xfs";
19+
};
20+
21+
"/boot" = {
22+
device = "/dev/disk/by-uuid/D7EE-6599";
23+
fsType = "vfat";
24+
};
25+
};
26+
27+
boot = {
28+
initrd = {
29+
availableKernelModules = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod"];
30+
kernelModules = ["usb_storage" "i2c-dev"];
31+
luks.devices.crypt = {
32+
device = "/dev/disk/by-uuid/d31e511f-f385-4993-9437-619e9501f535";
33+
allowDiscards = true;
34+
};
35+
};
36+
loader = {
37+
systemd-boot.enable = true;
38+
efi = {
39+
canTouchEfiVariables = false;
40+
};
41+
};
42+
kernelPackages = pkgs.linuxPackages_latest;
43+
kernelModules = ["kvm-intel"];
44+
extraModulePackages = with config.boot.kernelPackages; [v4l2loopback.out];
45+
tmp.useTmpfs = true;
46+
};
47+
48+
swapDevices = [];
49+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{flake, ...}: {
2+
imports = [
3+
flake.nixosModules.common
4+
flake.nixosModules.laptops
5+
./boot.nix
6+
];
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{flake, ...}: {
2+
imports = [
3+
flake.homeModules.shared
4+
flake.homeModules.headless
5+
];
6+
}

hosts/lusus/configuration.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{flake, ...}: {
2+
imports = [
3+
flake.nixosModules.common
4+
flake.nixosModules.laptops
5+
./boot.nix
6+
];
7+
}

hosts/lusus/default.nix

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
inputs,
3+
flake,
4+
...
5+
}: {
6+
imports = [
7+
flake.homeModules.shared
8+
flake.homeModules.graphical
9+
inputs.gridx.home-module
10+
];
11+
}

0 commit comments

Comments
 (0)