diff --git a/hosts/redshirt/configuration.nix b/hosts/redshirt/configuration.nix new file mode 100644 index 0000000..1818aeb --- /dev/null +++ b/hosts/redshirt/configuration.nix @@ -0,0 +1,71 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ../../base.nix + ./hardware-configuration.nix + ]; + + networking.hostName = "redshirt"; + networking.networkmanager.enable = true; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + # keyMap = "no"; + useXkbConfig = true; # use xkbOptions in tty. + }; + + # Enable the X11 windowing system. + services.xserver = { + enable = true; + windowManager = { + qtile.enable = true; + }; + # Enable touchpad support (enabled default in most desktopManager). + libinput.enable = true; + }; + + + # Configure keymap in X11 + services.xserver.layout = "no"; + + fonts.fonts = with pkgs; [ + (nerdfonts.override { fonts = [ "FiraCode" "Hack" ]; }) + ]; + + sound.enable = true; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + jack.enable = true; + }; + + users.users.felixalb = { + extraGroups = [ "networkmanager" ]; + shell = pkgs.zsh; + }; + + environment.systemPackages = with pkgs; [ + zsh + cifs-utils + ]; + + documentation.man.generateCaches = 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 = "22.05"; # Did you read the comment? + +} + diff --git a/hosts/redshirt/hardware-configuration.nix b/hosts/redshirt/hardware-configuration.nix new file mode 100644 index 0000000..fc98b1b --- /dev/null +++ b/hosts/redshirt/hardware-configuration.nix @@ -0,0 +1,38 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1446d565-a448-471f-bb7d-2fa519492573"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/678A-B7E8"; + 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/redshirt/home.nix b/hosts/redshirt/home.nix new file mode 100644 index 0000000..251666a --- /dev/null +++ b/hosts/redshirt/home.nix @@ -0,0 +1,112 @@ +{ 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"; + }; + }; +}