1
0
Fork 0

Prepare multi-system support

This commit is contained in:
Daniel Kempkens 2022-07-29 20:13:31 +02:00
parent 546bcb7d74
commit a3b4ab95f3
83 changed files with 120 additions and 112 deletions

View file

@ -3,7 +3,7 @@
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
@ -69,16 +69,16 @@
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
], ],
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1658751516, "lastModified": 1658924727,
"narHash": "sha256-Y/3dHoTjbvYBtWd+TTBQJUIgDPO9d+Gqt05C5dyR7E4=", "narHash": "sha256-Fhh9FK9CvuCLxG1WkWJPoendDeXKI4gHYTfezo1n2Zg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "dbed4c794d20d51027fc1107f063ec5be027dafc", "rev": "0e2f7876d2f2ae98a67d89a8bef8c49332aae5af",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -97,11 +97,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1658896062, "lastModified": 1659077058,
"narHash": "sha256-LJJaybijEjZJHFqpXX9dpTsGpK3NMEUaKAEuCYET+Dw=", "narHash": "sha256-C0HKHyeRp/ifJ9yacgTdbwu9RZRtKLjGUiKnE8kUElg=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "57ce6c2b8ff1dc3045f6e6be325d3e6b6b4fb15c", "rev": "02efdb4d587242122df99b347a25fd4c96b0ca97",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -116,15 +116,15 @@
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"neovim-flake": "neovim-flake", "neovim-flake": "neovim-flake",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1658909778, "lastModified": 1659082600,
"narHash": "sha256-Eu7GyXO9JCTYYJiuSJ28Z18fV1Ufwx0BNDpuTv+2Wkc=", "narHash": "sha256-9oYbGTpY0AG4otRlXeFif/e4BzfAzW7sZW3Z9Hfy0IU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "36ccc9c4bbe52ec826c51f1d991982e78174039b", "rev": "a95f350ae46ee90213078dffc351013bae797b94",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -136,15 +136,15 @@
"nifoc-overlay": { "nifoc-overlay": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1654961851, "lastModified": 1659040381,
"narHash": "sha256-zcYRu/Rc3WiM6ygNpcxidbQCEvXVrrTOuU8Mm/nrf84=", "narHash": "sha256-kk3ORGTFEccNY1tYlJ+ho6XxfqQLWr66FPD0tTppjlM=",
"owner": "nifoc", "owner": "nifoc",
"repo": "nix-overlay", "repo": "nix-overlay",
"rev": "a57dac5b77dc0718f1c5a0d6e809ed5e1f3d14ac", "rev": "212d8f80c7d3a252c8ca86aae442c9e8580aa224",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -153,13 +153,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1658822272, "lastModified": 1659072678,
"narHash": "sha256-M87AIbje5cNnAy9iP3uoufZFvxooqtJq2ZRXeUeBO44=", "narHash": "sha256-tOAZdTFilNCASEkwS2wCtSQkfWle7JKb4fXgKgTbpRc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cc895a46b238e2fb09844583e4566f09060d0f81", "rev": "1a1bd86756ca15f8bafdce4499d6a88089bec3b6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -175,7 +175,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nifoc-overlay": "nifoc-overlay", "nifoc-overlay": "nifoc-overlay",
"nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable",
"zig-overlay": "zig-overlay" "zig-overlay": "zig-overlay"
} }
}, },
@ -198,15 +198,15 @@
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1658883445, "lastModified": 1659056111,
"narHash": "sha256-o3ZNNtsJaemouGyrQByYLbN9eQv2HIlrExkhAu/5vcM=", "narHash": "sha256-Mbyp0uHZYXTHMaB2Ik4+kE/5fs+c0NXJ7OmJuBk6Dk8=",
"owner": "arqv", "owner": "arqv",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "8b2b7e416e943a603ec5a9a0c572b59e17807a1a", "rev": "965e5272ef9e12189349a95c12c3a40866aaa19a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,71 +1,41 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
darwin = { darwin = {
url = "github:lnl7/nix-darwin"; url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs-unstable";
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs-unstable";
}; };
neovim-nightly-overlay = { neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay"; url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs-unstable";
}; };
zig-overlay = { zig-overlay = {
url = "github:arqv/zig-overlay"; url = "github:arqv/zig-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs-unstable";
}; };
nifoc-overlay = { nifoc-overlay = {
url = "github:nifoc/nix-overlay"; url = "github:nifoc/nix-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs-unstable";
}; };
}; };
outputs = inputs@{ self, nixpkgs, darwin, home-manager, ... }: outputs = inputs@{ self, ... }:
let let
overlay-x86 = final: prev: { pkgs-x86 = import inputs.nixpkgs { system = "x86_64-darwin"; }; }; config-Styx = import ./system/flakes/Styx.nix {
overlay-neovim = inputs.neovim-nightly-overlay.overlay; nixpkgs = inputs.nixpkgs-unstable;
overlay-zig = final: prev: { zigpkgs = inputs.zig-overlay.packages.${prev.system}; }; inherit (inputs) home-manager;
overlay-nifoc = inputs.nifoc-overlay.overlay; inherit (inputs) darwin;
overlay-patches = import ./overlay-patches.nix; inherit inputs;
nixpkgsConfig = {
overlays = [
overlay-x86
overlay-neovim
overlay-zig
overlay-nifoc
overlay-patches
];
config = {
allowUnfree = true;
allowBroken = true;
};
}; };
in in
{ config-Styx;
darwinConfigurations."Styx" = darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
./darwin-configuration.nix
home-manager.darwinModules.home-manager
{
nixpkgs = nixpkgsConfig;
nix.nixPath = { nixpkgs = "${nixpkgs}"; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.daniel = import ./home.nix;
}
];
};
};
} }

View file

@ -2,31 +2,31 @@
{ {
imports = [ imports = [
./programs/fish.nix ../programs/fish.nix
./programs/starship.nix ../programs/starship.nix
./programs/direnv.nix ../programs/direnv.nix
./programs/kitty.nix ../programs/kitty.nix
./programs/nvim ../programs/nvim
./programs/git.nix ../programs/git.nix
./programs/bat.nix ../programs/bat.nix
./programs/fzf.nix ../programs/fzf.nix
./programs/jq.nix ../programs/jq.nix
./programs/texlive.nix ../programs/texlive.nix
./programs/pandoc.nix ../programs/pandoc.nix
./programs/podman.nix ../programs/podman.nix
./programs/scripts.nix ../programs/scripts.nix
./programs/ssh.nix ../programs/ssh.nix
./programs/yt-dlp.nix ../programs/yt-dlp.nix
]; ];
home = { home = {

View file

@ -96,7 +96,7 @@
shellAliases = { shellAliases = {
drsw = "nix-darwin-switch"; drsw = "nix-darwin-switch";
upa = "nix flake update ~/.config/nixpkgs -v && upn"; upa = "nix flake update ~/.config/nixpkgs -v && upn";
upn = "$HOME/.config/nixpkgs/programs/nvim/update-plugins.sh"; upn = "$HOME/.config/nixpkgs/home/programs/nvim/update-plugins.sh";
ngc = "nix-collect-garbage -d && sudo nix-collect-garbage -d"; ngc = "nix-collect-garbage -d && sudo nix-collect-garbage -d";
nsr = "sudo nix-store --verify --check-contents --repair"; nsr = "sudo nix-store --verify --check-contents --repair";

View file

@ -47,12 +47,12 @@
}; };
yanky-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { yanky-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "yanky.nvim"; pname = "yanky.nvim";
version = "2022-07-21"; version = "2022-07-29";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "gbprod"; owner = "gbprod";
repo = "yanky.nvim"; repo = "yanky.nvim";
rev = "57380fe70758dae6aeac5a304a0b28b3cff3cb5c"; rev = "d55f095b472a3d0355d3b7c5c84d4774ee769a7f";
sha256 = "11r5dvij20cr69rcaag5f03bvqmjhjshczchs2civhm9sycfzcm2"; sha256 = "1zj8dvyb2486kpim4vlmrpsyga2hny20q1ya9rmqxfnsahydpmnz";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -80,12 +80,12 @@
}; };
leap-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { leap-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "leap.nvim"; pname = "leap.nvim";
version = "2022-07-24"; version = "2022-07-26";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "ggandor"; owner = "ggandor";
repo = "leap.nvim"; repo = "leap.nvim";
rev = "4e6e6afe81052483bf0900dc2bb8882194b7be50"; rev = "2a11836d290560c746b75c424827660e4d94bd12";
sha256 = "1dffrxhg9n71z33vvnbnk7wj3yzvg52s8fxqnk8mqvv27s62d42j"; sha256 = "1x9s116h1qk5xxhi43d06h43rz8fwm5v1jc2mfldidnljkp3la10";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -153,12 +153,12 @@
}; };
project-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { project-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "project.nvim"; pname = "project.nvim";
version = "2022-05-29"; version = "2022-07-28";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "ahmedkhalf"; owner = "ahmedkhalf";
repo = "project.nvim"; repo = "project.nvim";
rev = "541115e762764bc44d7d3bf501b6e367842d3d4f"; rev = "e449497c0bceb6e50947b840ec3658bf1108bf0b";
sha256 = "0vabnhb5d8nc25ap9zixazmr4sm5ylq0iqzsc89cc3h1907xp6lz"; sha256 = "0kq464j8m67bmm2050pgzb284n6jfs8ivg9j2xns0czjkw9bm4nk";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -197,12 +197,12 @@
}; };
nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-lspconfig"; pname = "nvim-lspconfig";
version = "2022-07-25"; version = "2022-07-29";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "neovim"; owner = "neovim";
repo = "nvim-lspconfig"; repo = "nvim-lspconfig";
rev = "ba25b747a3cff70c1532c2f28fcc912cf7b938ea"; rev = "60f2993b9661d9844cee3bebdbd1b5860577eb3c";
sha256 = "0fnldljq3n7nnmjmwvn8mbfq5m34ca5kq1bgjdjpfsy2w2mhlabc"; sha256 = "0029s9i40x5ri104ray7hzw7c6xfryb18rq4rz8yq2wz65rr9npw";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -230,12 +230,12 @@
}; };
nvim-lint = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-lint = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-lint"; pname = "nvim-lint";
version = "2022-07-23"; version = "2022-07-27";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "mfussenegger"; owner = "mfussenegger";
repo = "nvim-lint"; repo = "nvim-lint";
rev = "4d0abb94776f860ed0eef7c2d7aae96a804cbee5"; rev = "754b18f33a3167f8ef0afe91a1960aa7db280535";
sha256 = "0b47zj8j1ag8y5avyb9zklfjivj18ns4h6n3n6a0shgyfmihn4r7"; sha256 = "0davfw57xv5z33685spsmh0mykr3cq0zpmk8by0a3p96pyrkfcv9";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -252,23 +252,23 @@
}; };
LuaSnip = pkgs.vimUtils.buildVimPluginFrom2Nix { LuaSnip = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "LuaSnip"; pname = "LuaSnip";
version = "2022-07-26"; version = "2022-07-27";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "L3MON4D3"; owner = "L3MON4D3";
repo = "LuaSnip"; repo = "LuaSnip";
rev = "281a89e374eb04663e18e786db5f215092a56595"; rev = "53e812a6f51c9d567c98215733100f0169bcc20a";
sha256 = "1xkysyqqwdhympljg44hgi5fbfgz042qx91vpf85j99wqhaiz4i4"; sha256 = "0qr84j39d4202ag1gvi26xilcsqwfw32d9lv96zc96a51l6r40y0";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
friendly-snippets = pkgs.vimUtils.buildVimPluginFrom2Nix { friendly-snippets = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "friendly-snippets"; pname = "friendly-snippets";
version = "2022-07-24"; version = "2022-07-27";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "rafamadriz"; owner = "rafamadriz";
repo = "friendly-snippets"; repo = "friendly-snippets";
rev = "5632135df892a742e5c3bbf97f0f634e273254d4"; rev = "8c95fecb3960eb0d3d3b9bd582d49a613bd7a7fb";
sha256 = "1j1q6zmbq9xgsmnyg9x8wg6dkasmbd629aw4p6cg0lij1fngc65s"; sha256 = "1y34pb7v7pk4zvjbab5bs5shcbxh0msiy6aijrkp119a1r0zpndj";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -494,12 +494,12 @@
}; };
toggleterm-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { toggleterm-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "toggleterm.nvim"; pname = "toggleterm.nvim";
version = "2022-07-25"; version = "2022-07-28";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "akinsho"; owner = "akinsho";
repo = "toggleterm.nvim"; repo = "toggleterm.nvim";
rev = "cd12ed737d3de2757a540ddf4962a6de05881127"; rev = "a7c9a6fd135f96639e2ac686691a32db6d011471";
sha256 = "032x7kmy8aqrc3lq6ns3jcicvjgwjhsfmfch3s20af48y6lp1xm7"; sha256 = "03avxz9l9kz3c99dqjk63zw5wi1s0vakas9wx8l74sqrr9b8pba0";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };

View file

@ -1 +0,0 @@
self: super: { }

39
system/flakes/Styx.nix Normal file
View file

@ -0,0 +1,39 @@
{ nixpkgs, home-manager, darwin, inputs, ... }:
let
overlay-x86 = _: _: { pkgs-x86 = import nixpkgs { system = "x86_64-darwin"; }; };
overlay-neovim = inputs.neovim-nightly-overlay.overlay;
overlay-zig = _: prev: { zigpkgs = inputs.zig-overlay.packages.${prev.system}; };
overlay-nifoc = inputs.nifoc-overlay.overlay;
nixpkgsConfig = {
overlays = [
overlay-x86
overlay-neovim
overlay-zig
overlay-nifoc
];
config = {
allowUnfree = true;
allowBroken = true;
};
};
in
{
darwinConfigurations."Styx" = darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
../hosts/Styx.nix
home-manager.darwinModules.home-manager
{
nixpkgs = nixpkgsConfig;
nix.nixPath = { nixpkgs = "${nixpkgs}"; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.daniel = import ../../home/hosts/Styx.nix;
}
];
};
}

View file

@ -1,7 +1,7 @@
{ {
imports = [ imports = [
./system/defaults.nix ../darwin/defaults.nix
./system/fonts.nix ../darwin/fonts.nix
]; ];
nix = { nix = {
@ -35,7 +35,7 @@
}; };
environment = { environment = {
darwinConfig = "$HOME/.config/nixpkgs/darwin-configuration.nix"; darwinConfig = "$HOME/.config/nixpkgs/system/hosts/Styx.nix";
variables = { variables = {
EDITOR = "nvim"; EDITOR = "nvim";