diff --git a/flake.nix b/flake.nix index 3967d4f1..4f6f2267 100644 --- a/flake.nix +++ b/flake.nix @@ -103,9 +103,10 @@ #modules = [ ]; # nixos-hardware.nixosModules.lenovo-thinkpad # Yubikey }; - box = { }; - hypercube = { }; - work = { }; + cube = { }; + # box = { }; + # hypercube = { }; + # work = { }; }; importables = rec { profiles = digga.lib.rakeLeaves ./profiles // { @@ -130,11 +131,11 @@ profiles = digga.lib.rakeLeaves ./users/profiles; suites = with profiles; rec { hmBase = [ direnv git ]; - #gui = [ base profiles.firefox profiles.desktop ]; + gui = [ hmBase profiles.firefox profiles.desktop ]; }; }; users = { - nixos = { suites, ... }: { imports = suites.base; }; + nixos = { suites, ... }: { imports = suites.hmBase; }; curve = { suites, ... }: { imports = suites.gui; }; }; # digga.lib.importers.rakeLeaves ./users/hm; }; @@ -154,7 +155,7 @@ }; }; - checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy.lib; + # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy.lib; } ; } diff --git a/hosts/cube/configuration.nix b/hosts/cube/configuration.nix new file mode 100644 index 00000000..7ce9a331 --- /dev/null +++ b/hosts/cube/configuration.nix @@ -0,0 +1,58 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only + + networking.hostName = "cube"; # Define your hostname. + + # Set your time zone. + time.timeZone = "Australia/Brisbane"; + + # Use flakes + nix = { + package = pkgs.nixFlakes; # or versioned attributes like nix_2_7 + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.ens3.useDHCP = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.anish = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDM0Zvei46x/yZl/IeBCq6+IYQQ0avulzVyBysF9cPigZMCybWRV7IEU+E3k9t6JrbdbdGfJkcZIWmsWDdKS8W8mBnZpVoT0ffLynu8JQ/TKdGm4Qv6bgUeKNrGsNv0ZPs2CDaGSLj0oJfRF7Ko10tcLP0vW+yujrh+y6TH/vVzJioaV4TGvtCUpn+wEQah9ROwPQLUUofsSWdnRsDJ/gp37zXWs4l5wyjSKtP3O9RZUP7kBekbSqEgSXiTk0oUQSVqIWl9NDiP6onk/gSOjXsR/JPqsSN/XI/c/yj6gyY0f51Ru2D7iBxuMJIJcWV+rU6coIj+ULcQWLzt/7TI8jq5AOOzI/ll4zbL24Eo84Rz+TP9tvMMhDZ0VaMN22AJ8qQEjc5P09tWKsX7Jg39XelyV1jHXncE4yvIE9F4RSCHzWCeKeXakizQNuzSaxTxIExRFYHjNW5bR6+3MTGwVrEIXU+qML+0yFTR86MT+tdY5AreAJQLwbog79O1NupeXJE= anish@curve" ]; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + ]; + + services.openssh.enable = true; + + # THIS VALUE DETERMINES THE nixOS RELEASE FROM WHICH THE DEFAULT + # SETTINGS FOR STATEFUL DATA, LIKE FILE LOCATIONS AND DATABASE VERSIONS + # ON YOUR SYSTEM WERE TAKEN. iT‘S PERFECTLY FINE AND RECOMMENDED TO LEAVE + # THIS VALUE AT THE RELEASE VERSION OF THE FIRST INSTALL OF THIS SYSTEM. + # BEFORE CHANGING THIS VALUE READ THE DOCUMENTATION FOR THIS OPTION + # (E.G. MAN CONFIGURATION.NIX OR ON HTTPS://NIXOS.ORG/NIXOS/OPTIONS.HTML). + system.stateVersion = "21.11"; # DID YOU READ THE COMMENT? + +} + diff --git a/hosts/cube/default.nix b/hosts/cube/default.nix new file mode 100644 index 00000000..d93a24f2 --- /dev/null +++ b/hosts/cube/default.nix @@ -0,0 +1,10 @@ +{ profiles, suites, ... }: +{ + imports = [ + ./configuration.nix + ]; # ++ [suites.cube]; + + #home-manager.users.anish = { self, suites, ... }: { + # imports = [ ] ++ suites.hmBase; + #}; +} diff --git a/hosts/cube/hardware-configuration.nix b/hosts/cube/hardware-configuration.nix new file mode 100644 index 00000000..323fc578 --- /dev/null +++ b/hosts/cube/hardware-configuration.nix @@ -0,0 +1,29 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/9233d8be-539f-43c8-9b83-84b5b4d72a93"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/E00D-9070"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/curve/configuration.nix b/hosts/curve/configuration.nix index 3947874e..6cf0cbc7 100644 --- a/hosts/curve/configuration.nix +++ b/hosts/curve/configuration.nix @@ -45,7 +45,6 @@ # }; sound.enable = true; - hardware.pulseaudio.enable = true; services.xserver.libinput.enable = true; } diff --git a/profiles/core/default.nix b/profiles/core/default.nix index 837bc57d..4947e40e 100644 --- a/profiles/core/default.nix +++ b/profiles/core/default.nix @@ -154,6 +154,7 @@ in # quick ssh sm = "ssh mossnet.lan"; ss = "ssh sealight.xyz"; + sc = "ssh lakhwara.com"; # cube }; }; diff --git a/profiles/nvim/default.nix b/profiles/nvim/default.nix deleted file mode 100644 index 443a0669..00000000 --- a/profiles/nvim/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ self, config, lib, pkgs, ... }: -{ - imports = [ ./nvim.nix ]; -} diff --git a/profiles/nvim/nvim.nix b/profiles/nvim/nvim.nix deleted file mode 100644 index ae3d5991..00000000 --- a/profiles/nvim/nvim.nix +++ /dev/null @@ -1,491 +0,0 @@ -{ pkgs, ... }: -let - customPlugins = { - vim-zettel = pkgs.vimUtils.buildVimPlugin { - name = "vim-zettel"; - src = pkgs.fetchFromGitHub { - owner = "michal-h21"; - repo = "vim-zettel"; - rev = "929d90eec62e6f693c2702d2b6f76a93f2f1689d"; - sha256 = "1fzKmknfVlEYwqeXgbKITbb2/PJ023iJyMz6vak3qh4="; - }; - }; - lsp-format = pkgs.vimUtils.buildVimPlugin { - name = "lsp-format"; - src = pkgs.fetchFromGitHub { - owner = "lukas-reineke"; - repo = "lsp-format.nvim"; - rev = "84e117b99bb2bc0d0c8122e2b256046f046f8aff"; - sha256 = "rs3NTZwWdsmBGXnrgUeVxUiNjbN/ULxJHifPYJD9mT4="; - }; - }; - vim-tidal = pkgs.vimUtils.buildVimPluginFrom2Nix { - name = "vim-tidal"; - src = pkgs.fetchgit { - url = "https://github.com/tidalcycles/vim-tidal"; - # version 1.4.6 - rev = "52134979252757a5736ae09cb9fc6ae3cc04daef"; - sha256 = "1x64d8jdlcw16pcp19xb0krd1jfqhva4xsxif8xc11pyj52sxxlh"; - }; - postInstall = '' - sed -i "s| split term://tidal| split term://$out/share/vim-plugins/vim-tidal/bin/tidal|g" $out/share/vim-plugins/vim-tidal/plugin/tidal.vim - cat plugin/tidal.vim | grep "term:" - ''; - dependencies = [ ]; - }; - }; - - my-python-packages = python-packages: with python-packages; [ - tasklib - pynvim - six - python-lsp-server - pylsp-mypy - python-lsp-black - pylint - black - # other python packages you want - ]; - python-with-my-packages = pkgs.python3.withPackages my-python-packages; -in -{ - environment.variables.EDITOR = "nvim"; - environment.shellAliases = { - k = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex; cd $OLDPWD"; - kz = "cd ~/kitaab/vimwiki; vim -c :VimwikiIndex -c :ZettelNew; cd $OLDPWD"; - }; - environment.systemPackages = with pkgs // customPlugins; [ - nodejs - python-with-my-packages - clojure-lsp - rnix-lsp - terraform-lsp - vale - clj-kondo - # Other LSPs or linters - (neovim.override { - vimAlias = true; - withPython3 = true; - extraPython3Packages = pkgs: with pkgs; [ tasklib six ]; - configure = { - packages.myPlugins = with pkgs.vimPlugins; { - start = [ - # general - vim-nix - fzf-vim - vim-elixir - emmet-vim - nerdtree - ayu-vim - goyo-vim - csv-vim - rainbow_parentheses-vim - vim-surround - vim-devicons - nvim-web-devicons - direnv-vim - vim-peekaboo - undotree - telescope-nvim - plenary-nvim - lualine-nvim - nvim-gps - nvim-treesitter - nvim-treesitter-context - dashboard-nvim - FTerm-nvim - barbar-nvim - - # kitaab stuff - vimwiki - taskwiki - vim-zettel - - # lsp stuff - nvim-lint - nvim-lspconfig - nvim-cmp - cmp-nvim-lsp - cmp-treesitter - nvim-lsp-ts-utils - cmp-conjure - cmp-buffer - cmp-tabnine - lspkind-nvim - cmp-path - cmp-spell - nvim-autopairs - cmp_luasnip - luasnip - lsp-format - - # git stuff - vim-fugitive - gitsigns-nvim - fzf-checkout-vim - - # Clojure stuff - conjure - vim-sexp - vim-sexp-mappings-for-regular-people - # testing - #vim-processing - #vim-tidal - ]; - }; - - customRC = '' - set tabstop=2 - set showmatch - set shiftwidth=2 - set noexpandtab - set autoindent - set undofile - set signcolumn=auto:4 - - " set foldmethod=indent " fold based on indent - set number - set nocompatible - set relativenumber - set showtabline=2 - set noexpandtab - set autowriteall - syntax on - set list lcs=tab:\|\ - filetype plugin on - - set termguicolors - let ayucolor="mirage" - colorscheme ayu - - " set spell - set spelllang=en_gb - set ignorecase - set smartcase - set incsearch - " if hidden is not set, TextEdit might fail. - set hidden - " Some servers have issues with backup files, see #649 - set nobackup - set nowritebackup - " Better display for messages - set cmdheight=2 - " You will have bad experience for diagnostic messages when it's default 4000. - set updatetime=300 - " don't give |ins-completion-menu| messages. - set shortmess+=c - " always show signcolumns - set signcolumn=yes - - " window - nmap wh :topleft vnew - nmap wl :botright vnew - nmap wk :topleft new - nmap wj :botright new - - " tabs - nmap rt :retab! - vmap rt :retab! - - let mapleader = "\" - let maplocalleader = "," - - " moving splits with vim movements. - :tnoremap h - :tnoremap j - :tnoremap k - :tnoremap l - :inoremap h - :inoremap j - :inoremap k - :inoremap l - :nnoremap h - :nnoremap j - :nnoremap k - :nnoremap l - :nnoremap "=strftime("%Y-%m-%d %H:%M") - :inoremap =strftime("%Y-%m-%d %H:%M") - :inoremap =strftime("%H:%M") - - " tidal nvim terminal - " let g:tidal_target = "terminal" - - " telescope - " Find files using Telescope command-line sugar. - nnoremap ff Telescope find_files - nnoremap fg Telescope live_grep - nnoremap fb Telescope buffers - nnoremap fh Telescope help_tags - nnoremap ft Telescope tags - - " exit normal mode in terminal - :tnoremap - - " Sexp in Conjure (since it's fennel) - " let g:sexp_filetypes = [ "fennel" ] - - let g:rainbow_active = 0 - autocmd BufReadPost,BufNewFile c,clj,cljs RainbowParenthesesToggleAll - - " general commands - map t :NERDTreeToggle - map s :w - map q :wq - map r :RainbowParenthesesToggleAll - map :noh - nnoremap Y y$ - " center moving - nnoremap n nzzzv - nnoremap N Nzzzv - nnoremap J mzJ'z - " undo points - inoremap , ,u - inoremap . .u - inoremap ? ?u - inoremap ! !u - inoremap ) )u - inoremap [ [u - inoremap ] ]u - inoremap { {u - inoremap ( (u - inoremap } }u - " moving text - vnoremap J :m '>+1gv=gv - vnoremap K :m '>-2gv=gv - inoremap :m .+1== - inoremap :m .-2== - nnoremap j :m .+1== - nnoremap k :m .-2== - " Pasting - :map sy :!xclip -i - :vmap sy "*y - :map sp :r!xclip -o - - " barbar - nnoremap gT :BufferPrevious - nnoremap gt :BufferNext - nnoremap gj :BufferPick - nnoremap gq :BufferClose - - " git - nnoremap ga :G fetch --all - nmap gs :G - nmap gh :diffget //3 - nmap gl :diffget //2 - nmap gb :GBranches - nnoremap gp :Git! push - nnoremap gd :Gdiff - nnoremap gc :G commit -v -q %:p - - " kitaab - map zs :ZettelSearch - map zo :ZettelOpen - map zn :ZettelNew - map zd :VimwikiDiary - map zf :Telescope oldfiles only_cwd=true - map wt :VimwikiMakeTomorrowDiaryNote - map wd :VimwikiMakeYesterdayDiaryNote - let g:vimwiki_list = [{ 'path': '~/kitaab/vimwiki', 'auto_tags': 1, 'auto_diary_index': 1, 'auto_generate_links': 1 }] - - let g:mapleader="\" - let g:dashboard_default_executive = 'telescope' - nmap ss :SessionSave - nmap sl :SessionLoad - nnoremap fh :DashboardFindHistory - nnoremap ff :DashboardFindFile - nnoremap fm :DashboardJumpMark - nnoremap cn :DashboardNewFile - autocmd FileType dashboard set showtabline=0 | autocmd WinLeave set showtabline=2 - - " fzf - " not sure we even use this - let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } } - - " lsp commands - nnoremap vd :lua vim.lsp.buf.definition() - nnoremap vi :lua require('telescope.builtin').lsp_implementation() - nnoremap vsh :lua vim.lsp.buf.signature_help() - nnoremap vrr :lua require('telescope.builtin').lsp_references() - nnoremap vrn :lua vim.lsp.buf.rename() - nnoremap vh :lua vim.lsp.buf.hover() - nnoremap vca :lua vim.lsp.buf.code_action() - nnoremap vsd :lua rim.lsp.diagnostic.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics() - nnoremap vn :lua vim.lsp.diagnostic.goto_next() - nnoremap vll :call LspLocationList() - nnoremap va :lua require('telescope.builtin').lsp_code_actions(require('telescope.themes').get_cursor()) - - " lua config - lua <vt', ':call v:lua.toggle_diagnostics()', {noremap = true, silent = true}) - - - -- autopairs - require('nvim-autopairs').setup{} - - -- Setup nvim-cmp. - local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require('cmp') - local cmp_autopairs = require('nvim-autopairs.completion.cmp') - local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) - end - local check_back_space = function() - local col = vim.fn.col(".") - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") ~= nil - end - cmp.setup { - formatting = { - format = function(entry, vim_item) - -- fancy icons and a name of kind - vim_item.kind = require("lspkind").presets.default[vim_item.kind] .. - " " .. vim_item.kind - -- set a name for each source - vim_item.menu = ({ - buffer = "[Buffer]", - nvim_lsp = "[LSP]", - cmp_tabnine = "[TabNine]", - look = "[Look]", - path = "[Path]", - spell = "[Spell]", - calc = "[Calc]", - })[entry.source.name] - return vim_item - end - }, - mapping = { - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.select_next_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 - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, {"i", "s"}), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - sources = { - {name = 'buffer'}, {name = 'nvim_lsp'}, - {name = "look"}, {name = "path"}, - {name = 'cmp_tabnine'}, {name = "calc"}, {name = "spell"}, - {name = 'cmp-conjure'} - }, - completion = {completeopt = 'menu,menuone,noinsert'} - } - cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = ' ' } })) - -- TabNine cmp - local tabnine = require('cmp_tabnine.config') - tabnine:setup({max_lines = 1000, max_num_results = 20, sort = true}) - - -- Setup lspconfig - require("lsp-format").setup {} - - local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) - require('lspconfig').clojure_lsp.setup {on_attach = require "lsp-format".on_attach} - require('lspconfig').rnix.setup {on_attach = require "lsp-format".on_attach} - require('lspconfig').pylsp.setup {on_attach = require "lsp-format".on_attach} - require('lspconfig').terraform_lsp.setup {on_attach = require "lsp-format".on_attach} - - require('gitsigns').setup { sign_priority=80 } - - -- treesitter - require('nvim-treesitter.configs').setup { ensure_installed={'nix', 'clojure', 'python', 'typescript'}} - - -- lualine - require('nvim-gps').setup {} - local gps = require('nvim-gps') - require('lualine').setup { - sections = { - lualine_c = { - 'filename', { gps.get_location, condition=gps.is_available }, - }, - lualine_y = { - function() - local msg = 'No Active Lsp' - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end - }, - } - } - - -- nvim-lint - require('lint').linters_by_ft = { - markdown = {'vale'}, - } - - -- f_term - local map = vim.api.nvim_set_keymap - local opts = { noremap = true, silent = true } - map('n', '', 'lua require("FTerm").toggle()', opts) - map('t', '', 'lua require("FTerm").toggle()', opts) - EOF - ''; - }; - } - ) - ]; -} diff --git a/profiles/wifi/default.nix b/profiles/wifi/default.nix index d98de847..98e2f9cd 100644 --- a/profiles/wifi/default.nix +++ b/profiles/wifi/default.nix @@ -1,31 +1,39 @@ { config, pkgs, ... }: { + networking.dhcpcd.wait = "background"; + networking.dhcpcd.extraConfig = "noarp"; networking.wireless.userControlled.enable = true; networking.wireless.networks = { - "Chester 11403" = { - pskRaw="43fcb0bea43633899a9885865c53ea79d268b9bdfb8c3f4013718e43e6672e5e"; - }; - "HSBNEWiFi"={ - pskRaw="0820d84980eeb47630f13f04804fc9add684a8feebb64ba914cafc48f569d801"; - }; - "TP-LINK_1D79"={ - pskRaw="6d960910c33a59e94b151281cc3982863b4b112d8a4efd1b165e4f8e52e7dae8"; - }; - "nadir"={ - pskRaw="92e0c1f0b3a1bada333964f0ee4ac04e0d9ba941aa3f29216cc3782595a41e5f"; - }; - "WiFi-399631"={ - pskRaw="2e312c9721e470847f751d8b844d264dc5e2612361a579fc0bdebd2135b5a8ea"; - }; - "line"={ - pskRaw="ec36a5a116224c12e305c90b7f3c5a0b7417abfaacf15828748f6a1e1e316c03"; - }; - "MEHRA"={ - pskRaw="e1573bc9e30fd68ac8a805b7c5f9871322ffcdac909746831555905c2e156abb"; - }; - "Sandeep1"={ - pskRaw="035972401640bf4dc2d8651c0b9df515a69f6bc2bffa07cc936183128a6ccf0a"; - }; + "Chester 11403" = { + pskRaw = "43fcb0bea43633899a9885865c53ea79d268b9bdfb8c3f4013718e43e6672e5e"; + }; + "HSBNEWiFi" = { + pskRaw = "0820d84980eeb47630f13f04804fc9add684a8feebb64ba914cafc48f569d801"; + }; + "TP-LINK_1D79" = { + pskRaw = "6d960910c33a59e94b151281cc3982863b4b112d8a4efd1b165e4f8e52e7dae8"; + }; + "nadir" = { + pskRaw = "92e0c1f0b3a1bada333964f0ee4ac04e0d9ba941aa3f29216cc3782595a41e5f"; + }; + "WiFi-399631" = { + pskRaw = "2e312c9721e470847f751d8b844d264dc5e2612361a579fc0bdebd2135b5a8ea"; + }; + "line" = { + pskRaw = "ec36a5a116224c12e305c90b7f3c5a0b7417abfaacf15828748f6a1e1e316c03"; + }; + "MEHRA" = { + pskRaw = "e1573bc9e30fd68ac8a805b7c5f9871322ffcdac909746831555905c2e156abb"; + }; + "Sandeep1" = { + pskRaw = "035972401640bf4dc2d8651c0b9df515a69f6bc2bffa07cc936183128a6ccf0a"; + }; + "chadpad" = { + pskRaw = "2594b3880a60817950bd60b2770c9793fd4cb784ed183f685a52502a9df2c7b1"; + }; + "Vodafone-07F38" = { + pskRaw = "4ffd87de73ed31ef1aee1d0d178857490afbda3f0bb8453a0baaee7b2576f302"; + }; }; } diff --git a/users/anish/default.nix b/users/anish/default.nix index 4ec5f91c..77fe3d71 100644 --- a/users/anish/default.nix +++ b/users/anish/default.nix @@ -1,11 +1,11 @@ -{hmUsers, ...}: +{ hmUsers, ... }: { #home-manager.users = { inherit (hmUsers) anish; }; users.users.anish = { - hashedPassword = "MVHHpy9gbe3ow"; description = "Personal user for Anish"; + hashedPassword = "MVHHpy9gbe3ow"; isNormalUser = true; extraGroups = [ "wheel" "audio" ]; }; diff --git a/users/profiles/desktop/bin/hotplug-monitor.sh b/users/profiles/desktop/bin/hotplug-monitor.sh new file mode 100755 index 00000000..0fc021a3 --- /dev/null +++ b/users/profiles/desktop/bin/hotplug-monitor.sh @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +connect() { + xrandr --output HDMI-2 --same-as eDP-1 +} + +disconnect() { + xrandr --output HDMI-2 --off +} + +xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect diff --git a/users/profiles/desktop/bin/powermenu b/users/profiles/desktop/bin/powermenu index 001c14a4..5846b2a2 100755 --- a/users/profiles/desktop/bin/powermenu +++ b/users/profiles/desktop/bin/powermenu @@ -11,7 +11,7 @@ log_out="\tLogout" # Variable passed to rofi options="$power_off\n$reboot\n$lock\n$suspend\n$log_out" -case "$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)" in +case "$(echo -e "$options" | $rofi_command -dmenu)" in " Shutdown") systemctl poweroff ;; @@ -19,7 +19,7 @@ case "$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)" in systemctl reboot ;; " Lock") - zzz # TODO doesn't do anything + dm-tool lock ;; "鈴 Sleep") dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause diff --git a/users/profiles/desktop/bin/screenshot b/users/profiles/desktop/bin/screenshot index 8e7b1d1e..a31c1bad 100755 --- a/users/profiles/desktop/bin/screenshot +++ b/users/profiles/desktop/bin/screenshot @@ -1,2 +1,3 @@ #!/usr/bin/env sh scrot ~/screenshots/%b%d::%H%M%S.png; +xclip -i < ~/screenshots/%b%d::%H%M%S.png; diff --git a/users/profiles/desktop/default.nix b/users/profiles/desktop/default.nix index a13877d1..a12ecbcd 100644 --- a/users/profiles/desktop/default.nix +++ b/users/profiles/desktop/default.nix @@ -65,6 +65,7 @@ in xclip xdotool rofi + rofimoji obs-studio lightdm dunst @@ -73,6 +74,9 @@ in pulseSupport = true; nlSupport = true; }) + papirus-icon-theme + calendar-cli + wyrd ]; @@ -141,8 +145,18 @@ in *.color239: #565761 *.color240: #6272a4 *.color241: #b6b6b2 - xsetroot -cursor_name left_ptr EOF + + # hotplug + connect() { + xrandr --output HDMI-2 --same-as eDP-1 + } + + disconnect() { + xrandr --output HDMI-2 --off + } + + xrandr | grep "HDMI-2 connected" &>>/dev/null && connect || disconnect ''; lightdm.enable = true; lightdm.greeters.mini.enable = true; @@ -153,6 +167,7 @@ in password-background-color = "#1E2029" window-color = "#181a23" border-color = "#181a23" + active-monitor=1 ''; }; windowManager.bspwm.enable = true; @@ -169,16 +184,24 @@ in siji font-awesome-ttf proggyfonts - (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; }) + (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Iosevka" ]; }) ]; home-manager.users.anish = { + xsession = { + enable = true; + pointerCursor = { + package = pkgs.capitaine-cursors; + name = "capitaine-cursors"; + }; + }; # Install themes home.packages = with pkgs; [ ayu-theme-gtk dracula-theme capitaine-cursors paper-icon-theme + papirus-icon-theme libsForQt5.qtstyleplugin-kvantum qt5ct gtk-engine-murrine @@ -186,8 +209,6 @@ in ]; xresources.properties = { - "Xcursor.theme" = "Paper"; - #"Xcursor.size"= 64; "*.foreground" = "#95E6CB"; "*.background" = "#1F2430"; "*.cursorColor" = "#BAE67E"; @@ -259,6 +280,7 @@ in ".local/bin/passmenu".source = ./bin/passmenu; ".local/bin/powermenu".source = ./bin/powermenu; ".local/bin/screenshot".source = ./bin/screenshot; + # ".local/bin/hotplug-monitor.sh".source = ./bin/hotplug-monitor.sh; }; qt = { diff --git a/users/profiles/desktop/polybar/config b/users/profiles/desktop/polybar/config index 6d89840e..0aa3a8bc 100644 --- a/users/profiles/desktop/polybar/config +++ b/users/profiles/desktop/polybar/config @@ -1,100 +1,136 @@ [colors] -black = ${xrdb:color0} -bblack = ${xrdb:color8} -red = ${xrdb:color1} -bred = ${xrdb:color9} -green = ${xrdb:color2} -bgreen = ${xrdb:color10} -yellow = ${xrdb:color3} -byellow = ${xrdb:color11} -blue = ${xrdb:color4} -bblue = ${xrdb:color12} -magenta = ${xrdb:color5} -bmagenta = ${xrdb:color13} -cyan = ${xrdb:color6} -bcyan = ${xrdb:color14} -white = ${xrdb:color7} -bwhite = ${xrdb:color15} -bg = ${xrdb:background} -fg = ${colors.magenta} +yellow = #ffd580 +orange = #fe8019 +blue = #73d0ff +green = #bae67e +red = #ff3333 +bg = #1f2430 +fg = #bfbab0 +icons = #bae67e +cyan = #95e6cb +text = ${xrdb:color2} +unfocus = ${xrdb:color1} +accent = #604c7e +sky = #73d0ff +mauve = #bae67e +alert = ${colors.yellow} + bg-alt = #1E2029 fg-alt = #373844 bg-dark = #181a23 -alert = ${colors.yellow} -accent = #604c7e +[bar/mybar] +; monitor = VGA-1 +override-redirect = false -[global/wm] -margin-top = 0 -margin-bottom = 34 +; Put the bar at the bottom of the screen +bottom = false -[bar/main] -monitor = ${env:MONITOR} -monitor-strict = true -enable-ipc = true -wm-restack = bspwm -# REQUIRED to move the window with hideit.sh -override-redirect = true +; Prefer fixed center position for the `modules-center` block fixed-center = true -background = ${colors.bg} -foreground = ${colors.fg} - width = 100% height = 34 -offset-x = 0 -offset-y = 0 -# bottom = true -overline-size = 0 -overline-color = #f00 -underline-size = 0 -underline-color = #00f +offset-x = +offset-y = -border-bottom-size = 0 -border-top-size = 1 -border-color = ${colors.bg-dark} +; Background ARGB color (e.g. #f00, #ff992a, #ddff1023) +background = ${colors.bg} -padding-left = 2 -padding-right = 2 -module-margin-left = 0 -module-margin-right = 0 +; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023) +foreground = ${colors.fg} -font-0 = "Fira Code:pixelsize=9;2" -font-1 = "Wuncon Siji:pixelsize=12;2" -font-2 = "Siji:pixelsize=10;2" +line-size = 0 +line-color = #fff -; modules-left = volume pad cpu memory pad pkg mail -modules-left = pulseaudio pad cpu memory pad fs -modules-center = bspwm -modules-right = syncthing redshift wlan pad network-up pad network-down pad battery pad date +; Number of spaces to add at the beginning/end of the bar +; Individual side values can be defined using: +; padding-{left,right} +padding-right = 1 +padding-left = 0 -;tray-position = center -;tray-padding = 2 -;tray-transparent = true -;tray-background = #0063ff +; Number of spaces to add before/after each module +; Individual side values can be defined using: +; module-margin-{left,right} +module-margin = 0 +margin-bottom = 34 + +font-0 = "Iosevka Term:pixelsize=13;4" +font-1 = "Iosevka Term:pixelsize=6;1" +font-2 = "Fira Code:pixelsize=13;2" +font-3 = "Siji:pixelsize=8;2" + +; Add module mpd for artist - title info +modules-left = bspwm sps volume +modules-center = title +modules-right = wireless-network sps battery sps memory sps cpu sps date + +; The separator will be inserted between the output of each module +separator = + +; This value is used to add extra spacing between elements +; @deprecated: This parameter will be removed in an upcoming version +spacing = 0 + +; Opacity value between 0.0 and 1.0 used on fade in/out +dim-value = 1.0 + +wm-name = bspwm + +tray-position = right + +; If true, the bar will not shift its +; contents when the tray changes +tray-detached = false + +; Tray icon max size +tray-maxsize = 16 + +tray-background = ${colors.bg} +;offset defined as pixel value (e.g. 35) or percentage (e.g. 50%) + +tray-offset-x = 0 +tray-offset-y = 0 + +; Pad the sides of each tray icon +tray-padding = 0 + +; Scale factor for tray clients +tray-scale = 1.0 + +wm-restack = bspwm + +dpi-x = 133 +dpi-y = 133 + +enable-ipc = false + +; Fallback click handlers that will be called if +; there's no matching module handler found. [module/bspwm] type = internal/bspwm pin-workspaces = true enable-click = true -# ws-icon-0 = 1; -# ws-icon-1 = 2; -# ws-icon-2 = 3; -# ws-icon-3 = 4; -# ws-icon-4 = 5; -# ws-icon-5 = 6; +ws-icon-0 = 1;%{T1}%{T-} +ws-icon-1 = 2;%{T1}%{T-} +ws-icon-2 = 3;%{T1}%{T-} +ws-icon-3 = 4;%{T1}%{T-} +ws-icon-4 = 5;%{T1}%{T-} ws-icon-default =  +; fuzzy-match = true format = label-padding = 1 +label-foreground = ${colors.green} label-focused = %icon% -label-focused-background = ${colors.bg-dark} -label-focused-foreground = ${colors.fg} +label-focused-background = ${colors.yellow} +label-focused-foreground = ${colors.bg} # label-focused-underline = ${colors.magenta} ; label-focused-foreground = ${xrdb:color2} label-focused-padding = 1 @@ -103,10 +139,11 @@ label-occupied = %icon% label-occupied-foreground = ${colors.accent} label-occupied-padding = 1 -; label-urgent = %icon% +label-urgent = %icon% label-urgent-foreground = ${colors.alert} ; label-urgent-background = ${colors.alert} label-urgent-padding = 1 +; label-urgent-font = 3 label-empty = %icon% label-empty-foreground = ${colors.fg-alt} @@ -114,272 +151,262 @@ label-empty-padding = 1 [module/date] type = internal/date -interval = 5 -label = %date% %time% -date = %A, %h %d -date-alt = %Y-%m-%d -time = %I:%M %p -time-alt = %H:%M:%S -format-prefix = "" -format-prefix-padding = 1 -; format-prefix-background = ${colors.bg-alt} -format-prefix-foreground = ${colors.accent} -; format-underline = ${xrdb:color4} +; Seconds to sleep between updates +interval = 1.0 -[module/fs] -type = internal/fs -mount-0 = / -mount-1 = /mnt/projects ; for desktops -mount-2 = /home ; for laptop -interval = 30 +; See "http://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string +; NOTE: if you want to use syntax tags here you need to use %%{...} +date = %{T1}%{T-}%{T2} %d/%a%{T-} -; Available tags: -; (default) -; -; -; -format-mounted = "" -format-mounted-foreground = ${colors.accent} -; Available tokens: -; %mountpoint% -; %type% -; %fsname% -; %percentage_free% -; %percentage_used% -; %total% -; %free% -; %used% -; Default: %mountpoint% %percentage_free%% +; Optional time format +time = %{T2} %H:%M%{T-} -; Available tags: -; (default) -format-unmounted = -label-unmounted = -label-unmounted-foreground = ${colors.fg-alt} +; if `date-alt` or `time-alt` is defined, clicking +; the module will toggle between formats +date-alt = %{T1}%{T-}%{T2} %a, %d %b %y%{T-} +time-alt = %{T2} %H:%M:%S%{T-} -bar-used-indicator = -bar-used-width = 8 -bar-used-foreground-0 = ${colors.fg} -bar-used-foreground-1 = ${colors.fg} -bar-used-foreground-2 = ${colors.yellow} -bar-used-foreground-3 = ${colors.alert} -bar-used-foreground-4 = ${colors.alert} -bar-used-fill = | -bar-used-empty = ¦ -bar-used-empty-foreground = ${colors.fg-alt} +label = %date%%time% +label-font = 0 +label-foreground = ${colors.green} -[module/xwindow] -type = internal/xwindow -label = %title:0:80:...% -label-padding-left = 2 +[module/wireless-network] +type = internal/network +interface = wlp3s0 -; [module/mpd] -; type = internal/mpd -; host = /home/hlissner/.config/mpd/mpd.sock -; -; format-online = -; format-padding = 5 -; -; label-song-maxlen = 45 -; label-song-ellipsis = true -; -; icon-prev =  -; icon-seekb =  -; icon-stop =  -; icon-play =  -; icon-pause =  -; icon-next =  -; icon-seekf =  -; -; icon-random =  -; icon-repeat =  -; -; toggle-on-foreground = ${colors.fg} -; toggle-off-foreground = #66 +label-connected = %essid% +label-connected-font = 2 +format-connected = +label-connected-foreground = #82b414 + +format-disconnected = +label-disconnected = "睊" +label-disconnected-foreground = #f92672 +label-disconnected-background = #99000000 + +ramp-signal-foreground = #82b414 +ramp-signal-0 = " " +ramp-signal-1 = " " +ramp-signal-2 = " " +ramp-signal-3 = " " +ramp-signal-4 = " " +ramp-signal-5 = " " [module/cpu] type = internal/cpu -interval = 2 -format = -format-prefix = "" -format-foreground = ${colors.accent} -; format-underline = #f90000 -; label = %percentage%% -format-padding = 1 -bar-load-indicator = -bar-load-width = 8 -bar-load-foreground-0 = ${colors.fg} -bar-load-foreground-1 = ${colors.fg} -bar-load-foreground-2 = ${colors.yellow} -bar-load-foreground-3 = ${colors.alert} -bar-load-foreground-4 = ${colors.alert} -bar-load-fill = | -bar-load-empty = ¦ -bar-load-empty-foreground = ${colors.fg-alt} +; Seconds to sleep between updates +; Default: 1 +interval = 0.5 + +label = %{T1}%{T-}%{T2} %percentage:2%%%{T-} + +label-foreground = ${colors.cyan} [module/memory] type = internal/memory -interval = 3 -format = -format-prefix = "" -format-prefix-foreground = ${colors.accent} -; format-underline = #4bffdc -; label = %percentage_used%% -format-padding-left = 1 -; Only applies if is used -bar-used-indicator = -bar-used-width = 8 -bar-used-foreground-0 = ${colors.fg} -bar-used-foreground-1 = ${colors.fg} -bar-used-foreground-2 = ${colors.yellow} -bar-used-foreground-3 = ${colors.alert} -bar-used-foreground-4 = ${colors.alert} -bar-used-fill = | -bar-used-empty = ¦ -bar-used-empty-foreground = ${colors.fg-alt} +; Seconds to sleep between updates +; Default: 1 +interval = 0.5 +format =