diff --git a/configuration.nix b/configuration.nix index e2cbe6c..045ba9a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -22,6 +22,10 @@ # 2. Matrix Synapse migration (https://matrix-org.github.io/synapse/latest/upgrade.html) system.stateVersion = "23.05"; + nixpkgs.source = builtins.fetchTarball + { url = "https://github.com/NixOS/nixpkgs/archive/66c7fa70cd1a.tar.gz"; + sha256 = "12a69mm612h2yxqkmak06km38hnxijnj6n76lrcl235j8c8zf8y0"; + }; boot.kernelPackages = pkgs.linuxPackages_latest; boot.tmp.useTmpfs = true; diff --git a/custom/default.nix b/custom/default.nix index 406ad59..5763116 100644 --- a/custom/default.nix +++ b/custom/default.nix @@ -10,6 +10,9 @@ # Safely handle secrets ./modules/secrets-store.nix + + # Pin Nixpkgs + ./modules/nixpkgs.nix ]; } diff --git a/custom/modules/nixpkgs.nix b/custom/modules/nixpkgs.nix new file mode 100644 index 0000000..d40c7d5 --- /dev/null +++ b/custom/modules/nixpkgs.nix @@ -0,0 +1,39 @@ +{ config, lib, ... }: + +let + nixpkgs = config.nixpkgs.source; + + conf = "${toString ../..}/configuration.nix"; + + rebuild = self: super: + { nixos-rebuild = super.nixos-rebuild.overrideAttrs (old: + { postInstall = old.postInstall + + '' + sed -i "$target" \ + -e '/^export PATH/ a \ + export NIX_PATH="nixpkgs=${nixpkgs}:nixos-config=${conf}"' \ + -e 's/remoteSudo=/remoteSudo=1/' \ + -e 's/-A system/-A system --no-out-link/' + ''; + }); + }; + +in + +{ + + options.nixpkgs.source = lib.mkOption + { type = lib.types.path; + description = "Nixpkgs sources"; + }; + + config = + { nixpkgs.pkgs = import nixpkgs { overlays = [ rebuild ]; }; + nix.nixPath = + [ "nixpkgs=/run/current-system/nixpkgs" + "nixos-config=${conf}" + ]; + system.extraSystemBuilderCmds = "ln -s ${nixpkgs} $out/nixpkgs"; + }; + +} diff --git a/email.nix b/email.nix index d55f0e8..d7a49af 100644 --- a/email.nix +++ b/email.nix @@ -3,8 +3,8 @@ { imports = [ (builtins.fetchTarball { - url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-23.05/nixos-mailserver-nixos-23.05.tar.gz"; - sha256 = "1ngil2shzkf61qxiqw11awyl81cr7ks2kv3r3k243zz7v2xakm5c"; + url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-24.05/nixos-mailserver-nixos-24.05.tar.gz"; + sha256 = "0clvw4622mqzk1aqw1qn6shl9pai097q62mq1ibzscnjayhp278b"; }) ]; diff --git a/jobs.nix b/jobs.nix index fbf6c20..6073223 100644 --- a/jobs.nix +++ b/jobs.nix @@ -17,6 +17,7 @@ with lib; systemd.services.ydns = { description = "update ydns address record"; + wants = [ "network-online.target" ]; after = [ "network-online.target" ]; startAt = "*:0/30"; diff --git a/neovim.nix b/neovim.nix index 360dfb2..a1c9aa9 100644 --- a/neovim.nix +++ b/neovim.nix @@ -19,9 +19,9 @@ let nix-queries fortran-queries (nvim-treesitter.withPlugins (p: with p; [ bash fish - fortran haskell + c haskell html css markdown - nix python + nix python lua ])) # Misc @@ -140,6 +140,7 @@ let opt.foldmethod = "expr" -- Folding opt.foldexpr = 'nvim_treesitter#foldexpr()' -- opt.foldlevel = 99 -- open by default + opt.foldopen:remove("search") -- don't open when searching -- -- OSC 52 clipboard diff --git a/packages.nix b/packages.nix index b1e9910..08a87cd 100644 --- a/packages.nix +++ b/packages.nix @@ -8,6 +8,12 @@ roomId = "!FsUSHSNMPMVTFFcvJo:maxwell.ydns.eu"; authToken = config.secrets.passwords.matrix; }; + + haskellPackages = super.haskellPackages.extend (hself: hsuper: + { breve = hself.callCabal2nix "breve" (builtins.fetchTarball + { url = "https://hackage.haskell.org/package/breve-0.5.1.0/breve-0.5.1.0.tar.gz"; + }) {}; + }); }); environment.systemPackages = with pkgs; [