From 20995a4f4a98c31e38e6400a113008ee64f2260f Mon Sep 17 00:00:00 2001 From: emily Date: Wed, 14 Feb 2024 19:42:25 +0100 Subject: [PATCH] basic conf --- config/common/users/emily/default.nix | 11 + config/hosts/ryuuko/configuration.nix | 17 +- .../hosts/ryuuko/hardware-configuration.nix | 41 +++ config/profiles/graphical/default.nix | 233 ++++++++++++++++ flake.lock | 263 ++++++++++++++++-- flake.nix | 6 +- 6 files changed, 550 insertions(+), 21 deletions(-) create mode 100644 config/hosts/ryuuko/hardware-configuration.nix diff --git a/config/common/users/emily/default.nix b/config/common/users/emily/default.nix index 2f59a2e..2de8c0a 100644 --- a/config/common/users/emily/default.nix +++ b/config/common/users/emily/default.nix @@ -43,6 +43,17 @@ programs.ripgrep.enable = true; programs.yt-dl.enable = true; + programs.eza = { + enable = true; + enableAlias = true; + icons = true; + git = true; + extraOptions = [ + "--color-scale=all" + "--color-scale-mode=gradient" + "--group-directories-first" + ]; + }; programs.git = { enable = true; signing.key = "B04F01A7A98A13020C39B4A68AB7B773A214ACE5"; diff --git a/config/hosts/ryuuko/configuration.nix b/config/hosts/ryuuko/configuration.nix index 23b427a..3f34dad 100644 --- a/config/hosts/ryuuko/configuration.nix +++ b/config/hosts/ryuuko/configuration.nix @@ -1,6 +1,21 @@ -{ ... }: { +{ config, ... }: { imports = [ ../../common ../../profiles/graphical + ./hardware-configuration.nix ]; + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + deployment = { + targetHost = "192.168.122.159"; + targetUser = "emily"; + }; + i18n.defaultLocale = "en_GB.UTF-8"; + networking.hostName = "ryuuko"; + networking.networkmanager.enable = true; + kyouma.machine-type.physical = true; + kyouma.machine-type.portable = true; + services.openssh.enable = true; } diff --git a/config/hosts/ryuuko/hardware-configuration.nix b/config/hosts/ryuuko/hardware-configuration.nix new file mode 100644 index 0000000..286f7fa --- /dev/null +++ b/config/hosts/ryuuko/hardware-configuration.nix @@ -0,0 +1,41 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/92cdb49a-4f15-4880-bf25-2ff1de20119c"; + fsType = "btrfs"; + options = [ "subvol=nixos" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/92cdb49a-4f15-4880-bf25-2ff1de20119c"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/DB0D-757F"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} + diff --git a/config/profiles/graphical/default.nix b/config/profiles/graphical/default.nix index f3d1b89..344b395 100644 --- a/config/profiles/graphical/default.nix +++ b/config/profiles/graphical/default.nix @@ -1,11 +1,15 @@ { config, pkgs, lib, inputs, ... }: { imports = [ inputs.home-manager.nixosModules.home-manager + inputs.stylix.nixosModules.stylix + inputs.nixvim.homeManagerModules.nixvim ]; kyouma.machine-type.graphical = true; + deployment.allowLocalDeployment = true; services.geoclue2.enable = true; + services.pipewire = { enable = true; alsa.enable = true; @@ -21,7 +25,37 @@ }; xdg.portal.wlr.enable = true; + stylix= { + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml"; + fonts = { + sansSerif = { + package = pkgs.noto-fonts; + name = "Noto Sans"; + }; + serif = config.stylix.fonts.sansSerif; + monospace = { + package = pkgs.jetbrains-mono; + name = "JetBrainsMono-Regular"; + }; + sizes.terminal = 11; + }; + cursor = { + package = pkgs.capitaine-cursors; + name = "capitaine"; + size = 24; + }; + }; + home-manager.users.emily = { + stylix.tagets = { + hyprland.enable = false; + kitty.enable = false; + mako.enable = false; + rofi.enable = false; + swaylock.enabke = false; + waybar.enable = false; + nixvim.enable = false; + }; home.keyboard = { layout = "de"; variant = "neo_qwerty"; @@ -350,6 +384,205 @@ programs.imv.enable = true; + programs.nixvim = { + extraPlugins. = [ pkgs.vimPlugins.molokai ]; + coloscheme = "molokai"; + vimAlias = true; + highlight.Normal = { + ctermbg = "NONE"; + guibg = "NONE"; + }; + options = { + number = true; + autoindent = true; + mouse = false; + encoding = "utf-8"; + shiftwidth = 2; + smartindent = true; + tabstop = 2; + + ignorecase = true; + incsearch = true; + smartcase = true; + }; + keymaps = [ + { + action = "Neotree toggle"; + key = ""; + mode = "n"; + options.silent = true; + } + { + action = ""; + key = ""; + mode = "t"; + } + ]; + plugins.nvim-cmp = { + enable = true; + sources = [ + { name = "nvim_lsp"; } + { name = "luasnip"; } + { name = "buffer"; } + { name = "nvim_lua"; } + { name = "path"; } + ]; + formatting = { + fields = [ "abbr" "kind" "menu" ]; + format = '' + function(_, item) + local icons = { + Namespace = "󰌗", + Text = "󰉿", + Method = "󰆧", + Function = "󰆧", + Constructor = "", + Field = "󰜢", + Variable = "󰀫", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "󰑭", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈚", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "󰙅", + Event = "", + Operator = "󰆕", + TypeParameter = "󰊄", + Table = "", + Object = "󰅩", + Tag = "", + Array = "[]", + Boolean = "", + Number = "", + Null = "󰟢", + String = "󰉿", + Calendar = "", + Watch = "󰥔", + Package = "", + Copilot = "", + Codeium = "", + TabNine = "", + } + + local icon = icons[item.kind] or "" + item.kind = string.format("%s %s", icon, item.kind or "") + return item + end + ''; + }; + snippet = { expand = "luasnip"; }; + window = { + completion = { + winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; + scrollbar = false; + sidePadding = 0; + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + }; + documentation = { + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + winhighlight = "FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel"; + }; + }; + mapping = { + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; + "" = { + modes = [ "i" "s" ]; + action = '' + function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif require("luasnip").expand_or_jumpable() then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") + else + fallback() + end + end + ''; + }; + "" = { + modes = [ "i" "s" ]; + action = '' + function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif require("luasnip").jumpable(-1) then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") + else + fallback() + end + end + ''; + }; + }; + }; + plugins.lsp = { + enable = true; + keymaps.lspBuf = { + "K" = "hover"; + "gd" = "definition"; + "gD" = "references"; + "gt" = "type_definition"; + "gi" = "implementation"; + }; + servers = { + bashls.enable = true; + lua-ls.enable = true; + nixd.enable = true; + ruff-lsp.enable = true; + }; + }; + plugins.none-ls = { + enable = true; + sources.diagnostics = { + pylint.enable = true; + shellcheck.enable = true; + statix.enable = true; + }; + sources.formatting = { + nixfmt.enable = true; + markdownlint.enable = true; + rustfmt.enable = true; + }; + }; + plugins.neo-tree = { + enable = true; + closeIfLastWindow = true; + }; + plugins.treesitter = { + enable = true; + nixGrammars = true; + indent = true; + }; + plugins.cmp-buffer.enable = true; + plugins.cmp-emoji.enable = true; + plugins.cmp-nvim-lsp.enable = true; + plugins.cmp-path.enable = true; + plugins.cmp_luasnip.enable = true; + plugins.luasnip.enable = true; + plugins.lightline.enable = true; + plugins.rainbow-delimiters.enable = true; + plugins.rustaceanvim.enable = true; + plugins.treesitter-context.enable = true; + }; + programs.wpaperd = { enable = true; settings.default = { diff --git a/flake.lock b/flake.lock index 5397a76..6df8b8c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,16 +1,33 @@ { "nodes": { + "communities": { + "flake": false, + "locked": { + "lastModified": 1706695952, + "narHash": "sha256-FlbOBX/+/LLmoqMJLvu59XuHYmiohIhDc1VjkZu4Wzo=", + "owner": "NLNOG", + "repo": "lg.ring.nlnog.net", + "rev": "20f9a9f3da8b1bc9d7046e88c62df4b41b4efb99", + "type": "github" + }, + "original": { + "owner": "NLNOG", + "repo": "lg.ring.nlnog.net", + "type": "github" + } + }, "fernglas": { "inputs": { + "communities": "communities", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1705593119, - "narHash": "sha256-bax2BqeVfLRILgevpVhT3PMhq/koBB/XzwLGhv6N2LU=", + "lastModified": 1707317562, + "narHash": "sha256-0wj5AS8RLVr+S/QWWxCsMvmVjmXUWGfR9kPaZimJEss=", "owner": "wobcom", "repo": "fernglas", - "rev": "2a63e52f6402e3d3ea1fd69091b044dd5b62a960", + "rev": "25020466957dbe0e193f7857d827020f5c1aa996", "type": "github" }, "original": { @@ -19,16 +36,53 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -55,17 +109,98 @@ "type": "github" } }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707919853, + "narHash": "sha256-qxmBGDzutuJ/tsX4gp+Mr7fjxOZBbeT9ixhS5o4iFOw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "043ba285c6dc20f36441d48525402bcb9743c498", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707467182, + "narHash": "sha256-/Bw/xgCXfj4nXDd8Xq+r1kaorfsYkkomMf5w5MpsDyA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "5b9156fa9a8b8beba917b8f9adbfd27bf63e16af", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "kyouma-www": { "inputs": { "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1705420537, - "narHash": "sha256-/zPsJsNFQF1xFIDY9np9TAK7JaiFLDcEhErNfcoyvIc=", + "lastModified": 1706043676, + "narHash": "sha256-yZKOLGKhwAvJl4iKkcTl08bNT4I0ul2w1WoejkeAGdY=", "ref": "refs/heads/main", - "rev": "b908e77c7173c6c425cbf085972f5ebbc7b83522", - "revCount": 15, + "rev": "c1e8e9fc90be19ce1f610f0b13082b6066b28f7d", + "revCount": 14, "type": "git", "url": "ssh://git@git.bsd.gay/snaki/kyouma-net.git" }, @@ -74,13 +209,34 @@ "url": "ssh://git@git.bsd.gay/snaki/kyouma-net.git" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1706833576, + "narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nixos-hardware": { "locked": { - "lastModified": 1706182238, - "narHash": "sha256-Ti7CerGydU7xyrP/ow85lHsOpf+XMx98kQnPoQCSi1g=", + "lastModified": 1707842204, + "narHash": "sha256-M+HAq1qWQBi/gywaMZwX0odU+Qb/XeqVeANGKRBDOwU=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "f84eaffc35d1a655e84749228cde19922fcf55f1", + "rev": "f1b2f71c86a5b1941d20608db0b1e88a07d31303", "type": "github" }, "original": { @@ -91,11 +247,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1699099776, - "narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", "type": "github" }, "original": { @@ -123,11 +279,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1705856552, - "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "lastModified": 1707689078, + "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8", "type": "github" }, "original": { @@ -153,12 +309,66 @@ "type": "github" } }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1707905367, + "narHash": "sha256-XqzKBGi8ItHQhnICLB36MHzABGW7JFQDuG0EURjRO0Q=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "f755eeb961a4d13ec72921cb4dbc4f2d6c8a58bb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_3", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1707297608, + "narHash": "sha256-ADjo/5VySGlvtCW3qR+vdFF4xM9kJFlRDqcC9ZGI8EA=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "0db2e67ee49910adfa13010e7f012149660af7f0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "fernglas": "fernglas", + "home-manager": "home-manager", "kyouma-www": "kyouma-www", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_3", + "nixvim": "nixvim", "secrix": "secrix" } }, @@ -209,6 +419,21 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index eabdee0..6411c8a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,9 +10,13 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, nixos-hardware, fernglas, kyouma-www, secrix, home-manager, ... }@inputs: { + outputs = { self, nixpkgs, secrix, ... }@inputs: { colmena = { meta = { allowApplyAll = false;