diff --git a/home/felixalb/home.nix b/home/felixalb/home.nix new file mode 100644 index 0000000..f19ad26 --- /dev/null +++ b/home/felixalb/home.nix @@ -0,0 +1,46 @@ +{ config, pkgs, ... }: +{ + imports = [ + ./nvim.nix + ]; + home.username = "felixalb"; + home.homeDirectory = "/home/felixalb"; + home.stateVersion = "22.11"; + + programs = { + home-manager.enable = true; + alacritty = { + enable = true; + }; + firefox.enable = true; + rofi.enable = true; + zsh = { + enable = true; + enableAutosuggestions = true; + enableSyntaxHighlighting = true; + prezto = { + enable = true; + prompt.theme = "paradox"; + }; + # initExtra = '' + # bindkey "''${key[Up]}" up-line-or-search + # bindkey "''${key[Down]}" down-line-or-search + # ''; + }; + git = { + enable = true; + userName = "Felix Albrigtsen"; + userEmail = "felixalbrigtsen@gmail.com"; + }; + }; + + services = { + redshift = { + enable = true; + tray = true; + + duskTime = "19:30-20:30"; + dawnTime = "7:30-8:30"; + }; + }; +} diff --git a/home/felixalb/nvim.nix b/home/felixalb/nvim.nix new file mode 100644 index 0000000..b24c4df --- /dev/null +++ b/home/felixalb/nvim.nix @@ -0,0 +1,69 @@ +{ pkgs, config, ... } +{ + programs.neovim = { + enable = true; + vimAlias = true; + + extraConfig = '' + set number " Show line numbers + set number relativenumber " Enable hybrid line numbers + set nu rnu + set signcolumn=number + set showmatch " Highlight matching brace + set errorbells " Beep or flash screen on errors + + set hlsearch " Highlight all search results + set smartcase " Enable smart-case search + set incsearch " Searches for strings incrementally + + set autoindent " Auto-indent new lines + set expandtab " Use spaces instead of tabs + set shiftwidth=2 " Number of auto-indent spaces + set smartindent " Enable smart-indent + set smarttab " Enable smart-tabs + set softtabstop=0 " Number of spaces per Tab, auto + + set updatetime=300 " Time interval for updating buffers + + set ruler " Show row and column ruler information + + set undolevels=1000 " Number of undo levels + set backspace=indent,eol,start " Backspace behaviour + ''; + + plugins = with pkgs.vimPlugins; [ + vim-nix + vim-commentary + vim-devicons + { plugin = nerdtree; + config = " + nmap :NERDTreeToggle + autocmd VimEnter * NERDTree \" Autostart nerdtree on vim startup + autocmd VimEnter * wincmd p \" Unselect nerdtree window + \" Close vim if Nerdtree is the only buffer left + autocmd bufenter * if (winnr(\"$\") == 1 && exists(\"b:NERDTree\") && b:NERDTree.isTabTree()) | q | endif + "; + } + ]; + withNodeJs = true; + coc = { + enable = true; + settings = { + "suggest.enablePreview" = true; + "suggest.enablePreselect" = true; + }; + + package = pkgs.vimUtils.buildVimPluginFrom2Nix { + pname = "coc.nvim"; + version = "2022-05-21"; + src = pkgs.fetchFromGitHub { + owner = "neoclide"; + repo = "coc.nvim"; + rev = "791c9f673b882768486450e73d8bda10e391401d"; + sha256 = "sha256-MobgwhFQ1Ld7pFknsurSFAsN5v+vGbEFojTAYD/kI9c="; + }; + meta.homepage = "https://github.com/neoclide/coc.nvim/"; + }; + }; + }; +} diff --git a/hosts/redshirt/configuration.nix b/hosts/redshirt/configuration.nix index ff3d8d8..6bcf9e5 100644 --- a/hosts/redshirt/configuration.nix +++ b/hosts/redshirt/configuration.nix @@ -2,12 +2,12 @@ { imports = - [ + [ ../../base.nix ./hardware-configuration.nix ]; - networking.hostName = "redshirt"; + networking.hostName = "redshirt"; networking.networkmanager.enable = true; # Select internationalisation properties. @@ -27,7 +27,17 @@ # Enable touchpad support (enabled default in most desktopManager). libinput.enable = true; }; - + + # The NixOS module enables critical components needed to run Hyprland properly, such as: polkit, xdg-desktop-portal-hyprland, graphics drivers, fonts, dconf, xwayland, and adding a proper Desktop Entry to your Display Manager. + programs.hyprland = { + enable = true; + package = pkgs.unstable.hyprland; + }; + + services.xserver.displayManager = { + lightdm.enable = true; + defaultSession = "hyprland"; + }; # Configure keymap in X11 services.xserver.layout = "no"; @@ -46,7 +56,6 @@ jack.enable = true; }; - # TODO: Enable home-manager with config from ./home.nix instead of users.users users.users.felixalb = { extraGroups = [ "networkmanager" ]; shell = pkgs.zsh; @@ -64,9 +73,7 @@ # 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 = "22.05"; # Did you read the comment? + system.stateVersion = "22.11"; } diff --git a/hosts/redshirt/home.nix b/hosts/redshirt/home.nix deleted file mode 100644 index 251666a..0000000 --- a/hosts/redshirt/home.nix +++ /dev/null @@ -1,112 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.username = "felixalb"; - home.homeDirectory = "/home/felixalb"; - home.stateVersion = "22.05"; - - programs = { - home-manager.enable = true; - alacritty = { - enable = true; - }; - firefox.enable = true; - rofi.enable = true; - zsh = { - enable = true; - enableAutosuggestions = true; - enableSyntaxHighlighting = true; - prezto = { - enable = true; - prompt.theme = "paradox"; - }; - # initExtra = '' - # bindkey "''${key[Up]}" up-line-or-search - # bindkey "''${key[Down]}" down-line-or-search - # ''; - }; - git = { - enable = true; - userName = "Felix Albrigtsen"; - userEmail = "felixalbrigtsen@gmail.com"; - }; - neovim = { - enable = true; - vimAlias = true; - - extraConfig = '' - - set number " Show line numbers - set number relativenumber " Enable hybrid line numbers - set nu rnu - set signcolumn=number - set showmatch " Highlight matching brace - set errorbells " Beep or flash screen on errors - - set hlsearch " Highlight all search results - set smartcase " Enable smart-case search - set incsearch " Searches for strings incrementally - - set autoindent " Auto-indent new lines - set expandtab " Use spaces instead of tabs - set shiftwidth=2 " Number of auto-indent spaces - set smartindent " Enable smart-indent - set smarttab " Enable smart-tabs - set softtabstop=0 " Number of spaces per Tab, auto - - set updatetime=300 " Time interval for updating buffers - - set ruler " Show row and column ruler information - - set undolevels=1000 " Number of undo levels - set backspace=indent,eol,start " Backspace behaviour - - ''; - - plugins = with pkgs.vimPlugins; [ - vim-nix - vim-commentary - vim-devicons - { plugin = nerdtree; - config = " - nmap :NERDTreeToggle - autocmd VimEnter * NERDTree \" Autostart nerdtree on vim startup - autocmd VimEnter * wincmd p \" Unselect nerdtree window - \" Close vim if Nerdtree is the only buffer left - autocmd bufenter * if (winnr(\"$\") == 1 && exists(\"b:NERDTree\") && b:NERDTree.isTabTree()) | q | endif - "; - } - ]; - withNodeJs = true; - coc = { - enable = true; - settings = { - "suggest.enablePreview" = true; - "suggest.enablePreselect" = true; - }; - - package = pkgs.vimUtils.buildVimPluginFrom2Nix { - pname = "coc.nvim"; - version = "2022-05-21"; - src = pkgs.fetchFromGitHub { - owner = "neoclide"; - repo = "coc.nvim"; - rev = "791c9f673b882768486450e73d8bda10e391401d"; - sha256 = "sha256-MobgwhFQ1Ld7pFknsurSFAsN5v+vGbEFojTAYD/kI9c="; - }; - meta.homepage = "https://github.com/neoclide/coc.nvim/"; - }; - }; - }; - }; - - services = { - redshift = { - enable = true; - tray = true; - - duskTime = "19:30-20:30"; - dawnTime = "7:30-8:30"; - }; - }; -}