diff options
| -rw-r--r-- | flake.lock | 10 | ||||
| -rw-r--r-- | flake.nix | 18 | ||||
| -rw-r--r-- | home.nix | 13 | ||||
| -rw-r--r-- | modules/default.nix | 3 | ||||
| -rw-r--r-- | modules/global.nix | 14 | ||||
| -rw-r--r-- | modules/neovim/default.nix (renamed from modules/nvim/default.nix) | 16 | ||||
| -rw-r--r-- | modules/neovim/keybinds.lua (renamed from modules/nvim/keybinds.lua) | 2 | ||||
| -rw-r--r-- | modules/neovim/settings.lua (renamed from modules/nvim/settings.lua) | 0 | ||||
| -rw-r--r-- | modules/qutebrowser/default.nix | 13 | ||||
| -rw-r--r-- | modules/sway/default.nix | 24 |
10 files changed, 82 insertions, 31 deletions
@@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1740254115, - "narHash": "sha256-MwxDtYB/MSGZlr/xS+ExGYH2QgHk73ShD40shxjad/Y=", + "lastModified": 1740283128, + "narHash": "sha256-R61wtNknWWejnl+K0l4sxu/wnLNFbNe44tNM2zbj5yE=", "owner": "nix-community", "repo": "home-manager", - "rev": "cb3f6e9b59d3a5e51ef9f7da2b8418d5c72aaef8", + "rev": "ed030a787938cae01d693ebaad52bbb672a4a69d", "type": "github" }, "original": { @@ -46,13 +46,13 @@ "lastModified": 1713543440, "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", "owner": "nix-community", - "repo": "nixGL", + "repo": "nixgl", "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", "type": "github" }, "original": { "owner": "nix-community", - "repo": "nixGL", + "repo": "nixgl", "type": "github" } }, @@ -10,13 +10,14 @@ }; nixgl = { - url = "github:nix-community/nixGL"; + url = "github:nix-community/nixgl"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = inputs@{ + self, nixpkgs, home-manager, nixgl, @@ -31,17 +32,18 @@ config.allowUnfree = true; inherit system overlays; }; - custom = import "custom.nix"; + inherit (pkgs) lib; in { packages.${system}.default = home-manager.defaultPackage.${system}; homeConfigurations = { - "stefan" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { - inherit inputs; - }; - modules = [ ./home.nix ]; + inherit inputs system pkgs; + "stefan" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit system inputs pkgs; }; + modules = [ ./home.nix ]; }; + }; }; } @@ -1,4 +1,4 @@ -{ inputs, config, lib, pkgs, ... }: +{ inputs, config, lib, pkgs, nixgl, ... }: { imports = [ ./modules/global.nix @@ -6,6 +6,17 @@ ]; config.modules = { + global = { + notNixOS = true; + }; foot.enable = true; + + + neovim = { + enable = true; + }; +# sway = { +# enable = true; +# }; }; } diff --git a/modules/default.nix b/modules/default.nix index 65bf42a..bb06c36 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,6 +3,7 @@ imports = [ ./foot.nix ./sway - ./nvim + ./neovim + ./qutebrowser ]; } diff --git a/modules/global.nix b/modules/global.nix index e187685..f26be5f 100644 --- a/modules/global.nix +++ b/modules/global.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ...}: +{ config, lib, pkgs, inputs, ...}: let cfg = config.modules.global; in @@ -20,11 +20,18 @@ in foot.enable = true; sway = { enable = true; - package = if cfg.notNixOS then - config.lib.nixGL.wrap pkgs.sway else pkgs.sway; + wrapWithNixGL = true; +# package = if cfg.notNixOS then + # (config.lib.nixGL.wrap pkgs.sway) else pkgs.sway; +# package = config.lib.nixGL.wrap pkgs.sway; }; }; + nixGL = lib.mkIf cfg.notNixOS { + packages = inputs.nixgl.packages; + defaultWrapper = "mesa"; + }; + programs = { home-manager.enable = true; }; @@ -44,6 +51,7 @@ in wl-clipboard mako wmenu + cmatrix ]); }; diff --git a/modules/nvim/default.nix b/modules/neovim/default.nix index 54f9d53..775f420 100644 --- a/modules/nvim/default.nix +++ b/modules/neovim/default.nix @@ -1,15 +1,16 @@ { config, lib, pkgs, ...}: let - cfg = config.modules.nvim; + cfg = config.modules.neovim; lua = str: "lua << EOF\n${str}\nEOF\n"; luaImport = file: "lua << EOF\n${builtins.readFile file}\nEOF\n"; in { - options.modules.nvim = { + options.modules.neovim = { + enable = lib.mkEnableOption "neovim"; }; config = { - programs.neovim = { + programs.neovim = lib.mkIf cfg.enable { enable = true; defaultEditor = true; viAlias = true; @@ -22,7 +23,7 @@ in servers = [ { name = "clangd"; } ]; - in lua(pkgs.lib.strings.concatStrings (pkgs.lib.lists.forEach servers (s: "require('lspconfig')['${s.name}'].setup(${s.config or "{}"})\n"))); + in lua (pkgs.lib.strings.concatStrings (pkgs.lib.lists.forEach servers (s: "require('lspconfig')['${s.name}'].setup(${s.config or "{}"})\n"))); } (nvim-treesitter.withPlugins (p: with p; [ @@ -34,6 +35,12 @@ in tree-sitter-markdown-inline ])) + { + plugin = neorg; + config = lua '' + require("neorg").setup() + ''; + } base16-nvim telescope-nvim telescope-fzf-native-nvim @@ -41,6 +48,7 @@ in extraLuaConfig = '' ${builtins.readFile ./settings.lua} ${builtins.readFile ./keybinds.lua} + require("neorg").setup() ''; }; }; diff --git a/modules/nvim/keybinds.lua b/modules/neovim/keybinds.lua index 1c1c512..cbd46c5 100644 --- a/modules/nvim/keybinds.lua +++ b/modules/neovim/keybinds.lua @@ -5,7 +5,7 @@ local function nmap(lhs, rhs, opts) end local function swap(mode, bind1, bind2) - local tmp=bind1 + local tmp=bind1 map(mode, bind1, bind2) map(mode, bind2, tmp) end diff --git a/modules/nvim/settings.lua b/modules/neovim/settings.lua index 816757c..816757c 100644 --- a/modules/nvim/settings.lua +++ b/modules/neovim/settings.lua diff --git a/modules/qutebrowser/default.nix b/modules/qutebrowser/default.nix new file mode 100644 index 0000000..283ea80 --- /dev/null +++ b/modules/qutebrowser/default.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, inputs, ... }: +let + cfg = config.modules.qutebrowser; +in +{ + config = { + programs.qutebrowser = { + enable = true; + package = config.lib.nixGL.wrap pkgs.qutebrowser; + loadAutoconfig = true; + }; + }; +} diff --git a/modules/sway/default.nix b/modules/sway/default.nix index 6a21685..d48ef32 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -1,19 +1,28 @@ -{ config, lib, pkgs, ... }: +{ self, config, lib, pkgs, nixgl, ... }: let cfg = config.modules.sway; in { options.modules.sway = { enable = lib.mkEnableOption "sway"; - package = lib.mkOption { - type = with lib.types; nullOr package; - default = pkgs.sway; - }; + wrapWithNixGL = lib.mkEnableOption "NixGL wrapper"; }; config = { + home.packages = with pkgs; [(writeShellScriptBin "browser" '' + swaymsg 'set $PROP newcont:tabbed ; exec qutebrowser --target window' + '')]; wayland.windowManager.sway = lib.mkIf cfg.enable { enable = true; - package = cfg.package; +# package = if cfg.wrapWithNixGL then config.lib.nixGL.wrap pkgs.sway else pkgs.sway; + package = config.lib.nixGL.wrap pkgs.sway; +# package = c +# package = pkgs.sway; +# package = pkgs.writeShellScriptBin "sway" '' +# ${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL ${pkgs.sway}/bin/sway +# ''; +# extraSessionCommands='' +# source ${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL +# ''; config = rec { modifier = "Mod1"; @@ -24,7 +33,7 @@ in fonts = { names = [ "ComicShannsMono Nerd Font Mono" ]; # material - size = 11.0; + size = 10.0; }; terminal = "foot"; @@ -248,4 +257,3 @@ in }; }; } - |