Merge branch 'nixos' into nixos-work
This commit is contained in:
commit
d7bc220d7d
8 changed files with 210 additions and 188 deletions
|
|
@ -90,6 +90,19 @@ in
|
|||
stable.texlive.combined.scheme-full # NOTE breaks often
|
||||
thunderbird
|
||||
vlc
|
||||
(symlinkJoin {
|
||||
name = "obsidian-wayland";
|
||||
paths = [ obsidian ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/obsidian \
|
||||
--add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland"
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"electron-25.9.0" # obsidian
|
||||
];
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
|
|
@ -50,21 +49,23 @@ in
|
|||
userName = cfg.identity.name;
|
||||
userEmail = cfg.identity.email;
|
||||
extraConfig = {
|
||||
commit.verbose = true;
|
||||
diff.algorithm = "histogram";
|
||||
fetch.fsckobjects = true;
|
||||
init.defaultBranch = "main";
|
||||
merge.conflictstyle = "zdiff3";
|
||||
diff.external = getExe pkgs.difftastic;
|
||||
push.autoSetupRemote = true;
|
||||
receive.fsckObjects = true;
|
||||
transfer.fsckobjects = true;
|
||||
};
|
||||
signing = mkIf cfg.signing {
|
||||
key = "0x970C6E89EB0547A9";
|
||||
signByDefault = true;
|
||||
};
|
||||
lfs.enable = true;
|
||||
delta.enable = true;
|
||||
};
|
||||
};
|
||||
programs.git = {
|
||||
enable = true;
|
||||
config.safe.directory = "/home/moritz/.dotfiles";
|
||||
};
|
||||
programs.git.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,23 @@
|
|||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.nix;
|
||||
|
||||
mkSuper = system: nix:
|
||||
if cfg.useSuper
|
||||
then inputs.nix-super.packages.${system}.default
|
||||
else nix;
|
||||
|
||||
mkNom = system: nix:
|
||||
if cfg.useNom
|
||||
then
|
||||
inputs.nix-monitored.packages.${system}.default.override
|
||||
{
|
||||
withNotify = false;
|
||||
nix = nix;
|
||||
}
|
||||
else nix;
|
||||
|
||||
mkNix = system: nix: mkNom system (mkSuper system nix);
|
||||
in
|
||||
{
|
||||
options.my.programs.nix = {
|
||||
|
|
@ -21,48 +38,65 @@ in
|
|||
};
|
||||
};
|
||||
optimise.enable = mkEnableOption "nix-optimise";
|
||||
useSuper = mkEnableOption "use nix super" // { default = true; };
|
||||
useNom = mkEnableOption "use nix output monitor by default" // { default = true; };
|
||||
};
|
||||
|
||||
config.nix = {
|
||||
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||
config = {
|
||||
my.nixpkgs.overlays = [
|
||||
(final: prev:
|
||||
{
|
||||
nixos-rebuild = prev.nixos-rebuild.override {
|
||||
nix = mkNom final.system final.nix;
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
package = inputs.nix-super.packages.${pkgs.system}.default;
|
||||
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
|
||||
gc = {
|
||||
automatic = cfg.gc.enable;
|
||||
options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d";
|
||||
dates = "weekly";
|
||||
home-manager.users.moritz.programs.direnv.nix-direnv.package = pkgs.nix-direnv.override {
|
||||
nix = config.nix.package;
|
||||
};
|
||||
|
||||
optimise = {
|
||||
automatic = cfg.optimise.enable;
|
||||
dates = [ "weekly" ];
|
||||
};
|
||||
nix = {
|
||||
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||
|
||||
registry = {
|
||||
master-upstream.to = {
|
||||
type = "github";
|
||||
owner = "nixos";
|
||||
repo = "nixpkgs";
|
||||
package = mkNix pkgs.system pkgs.nix;
|
||||
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
|
||||
gc = {
|
||||
automatic = cfg.gc.enable;
|
||||
options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d";
|
||||
dates = "weekly";
|
||||
};
|
||||
master.flake = inputs.master;
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
stable.flake = inputs.stable;
|
||||
dotfiles.flake = self;
|
||||
default.flake = self;
|
||||
};
|
||||
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://cache.nixos.org/"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
];
|
||||
optimise = {
|
||||
automatic = cfg.optimise.enable;
|
||||
dates = [ "weekly" ];
|
||||
};
|
||||
|
||||
trusted-users = [ "root" "@wheel" ];
|
||||
registry = {
|
||||
master-upstream.to = {
|
||||
type = "github";
|
||||
owner = "nixos";
|
||||
repo = "nixpkgs";
|
||||
};
|
||||
master.flake = inputs.master;
|
||||
nixpkgs.flake = inputs.nixpkgs;
|
||||
stable.flake = inputs.stable;
|
||||
dotfiles.flake = self;
|
||||
default.flake = self;
|
||||
};
|
||||
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://cache.nixos.org/"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
];
|
||||
|
||||
trusted-users = [ "root" "@wheel" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,26 +10,6 @@ in
|
|||
options.my.programs.nvim.enable = mkEnableOption "nvim";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
my.nixpkgs.overlays = [
|
||||
(
|
||||
_: prev:
|
||||
with lib.my;
|
||||
{
|
||||
vimPlugins = prev.vimPlugins // {
|
||||
nvim-treesitter = prev.vimPlugins.nvim-treesitter.overrideAttrs (_: {
|
||||
version = mkVersionInput inputs.nvim-treesitter;
|
||||
src = inputs.nvim-treesitter;
|
||||
});
|
||||
|
||||
# HACK: to fix error in nixpkgs version of nvim-lspconfig
|
||||
nvim-lspconfig = prev.vimPlugins.nvim-lspconfig.overrideAttrs (_: {
|
||||
version = mkVersionInput inputs.nvim-lspconfig;
|
||||
src = inputs.nvim-lspconfig;
|
||||
});
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
home-manager.users.moritz = {
|
||||
xdg.configFile."nvim/snippets" = {
|
||||
recursive = true;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,10 @@ with builtins;
|
|||
lazy = false;
|
||||
}
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
plugin = pkgs.vimPlugins.nvim-lspconfig.overrideAttrs (_: {
|
||||
version = lib.my.mkVersionInput inputs.nvim-lspconfig;
|
||||
src = inputs.nvim-lspconfig;
|
||||
});
|
||||
event = [ "BufRead" "BufNewFile" ];
|
||||
conf = readFile ./lua/nvim-lspconfig.lua;
|
||||
dependencies = [
|
||||
|
|
@ -266,14 +269,6 @@ with builtins;
|
|||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = pkgs.vimUtils.buildVimPlugin {
|
||||
pname = "nvim-puppeteer";
|
||||
version = lib.my.mkVersionInput inputs.nvim-puppeteer;
|
||||
src = inputs.nvim-puppeteer;
|
||||
};
|
||||
lazy = false; # NOTE: plugin lazy-loads itself.
|
||||
}
|
||||
{
|
||||
plugin = conform-nvim;
|
||||
keys = [
|
||||
|
|
|
|||
|
|
@ -56,9 +56,7 @@ with builtins;
|
|||
require('nvim-treesitter.configs').setup(final_opts)
|
||||
'';
|
||||
init = ''
|
||||
local runtimepath = vim.opt.runtimepath:get()
|
||||
table.insert(runtimepath, 4, "${parserDir}")
|
||||
vim.opt.runtimepath = runtimepath
|
||||
vim.opt.runtimepath:prepend("${parserDir}")
|
||||
'';
|
||||
priority = 100;
|
||||
dependencies = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue