diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..904df42 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,35 @@ +# System configuration and packages for my personal NixOS setup + +{ config, pkgs, ... }: + +{ + imports = [ + # include local machine/environment config + ./local.nix + ./programs + ]; + nixpkgs.config.allowUnfree = true; + environment.systemPackages = with pkgs; [ + fishPlugins.tide + neovim + wget + git + htop + btop + dig + ]; + + environment.shellAliases = { + vi = "nvim"; + vim = "nvim"; + }; + + programs.direnv.enable = true; + users.defaultUserShell = pkgs.fish; + + services.tailscale.enable = true; + services.tailscale.useRoutingFeatures = "client"; + + system.stateVersion = "23.05"; + +} diff --git a/machines/bento-wsl-nixos/configuration.nix b/machines/bento-wsl-nixos/configuration.nix deleted file mode 100644 index d9e27a2..0000000 --- a/machines/bento-wsl-nixos/configuration.nix +++ /dev/null @@ -1,42 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - -# NixOS-WSL specific options are documented on the NixOS-WSL repository: -# https://github.com/nix-community/NixOS-WSL - -{ config, lib, pkgs, ... }: - -{ - imports = [ - # include NixOS-WSL modules - - ]; - - wsl.enable = true; - wsl.defaultUser = "nixos"; - - environment.systemPackages = [ - pkgs.neovim - pkgs.git - pkgs.btop - pkgs.dig - ]; - - # 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 = "23.05"; # Did you read the comment? - - # Automatic Garbage Collection - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - -} - diff --git a/machines/bento-wsl-nixos/local.nix b/machines/bento-wsl-nixos/local.nix new file mode 100644 index 0000000..7c87428 --- /dev/null +++ b/machines/bento-wsl-nixos/local.nix @@ -0,0 +1,18 @@ +{ ... }: + +{ + imports = [ + # include NixOS-WSL modules + + ]; + + wsl.enable = true; + wsl.defaultUser = "nixos"; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + +} diff --git a/machines/snails/configuration.nix b/machines/snails/local.nix similarity index 50% rename from machines/snails/configuration.nix rename to machines/snails/local.nix index 92a8b64..c43918c 100644 --- a/machines/snails/configuration.nix +++ b/machines/snails/local.nix @@ -1,22 +1,15 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: +{ ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ ./hardware-configuration.nix ]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "snail"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - + networking.hostName = "snail"; + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant + # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; @@ -54,8 +47,7 @@ layout = "us"; xkbVariant = ""; }; - - # Enable CUPS to print documents. + # Enable CUPS to print documents. services.printing.enable = true; # Enable sound with pipewire. @@ -66,7 +58,7 @@ enable = true; alsa.enable = true; alsa.support32Bit = true; - pulse.enable = true; + pulse.enable = true; # If you want to use JACK applications, uncomment this #jack.enable = true; @@ -89,56 +81,9 @@ ]; }; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - fishPlugins.tide - neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - git - htop - dig - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - programs.fish.enable = true; - programs.direnv.enable = true; - users.defaultUserShell = pkgs.fish; - # fonts fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; }) ]; - - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - services.tailscale.enable = true; - services.tailscale.useRoutingFeatures = "client"; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # 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 = "23.05"; # Did you read the comment? - } + diff --git a/programs/default.nix b/programs/default.nix new file mode 100644 index 0000000..a395ba2 --- /dev/null +++ b/programs/default.nix @@ -0,0 +1,5 @@ +{ ... }: { + imports = [ + ./fish + ]; +} diff --git a/programs/fish/default.nix b/programs/fish/default.nix new file mode 100644 index 0000000..1eaa15e --- /dev/null +++ b/programs/fish/default.nix @@ -0,0 +1,15 @@ +{ ... }: { +programs = { + fish = { + enable = true; + + # Fish shellAbbrs + shellAbbrs = { + garbage = "sudo nix-collect-garbage --delete-older-than 7d"; + rbs = "sudo nixos-rebuild switch"; + rebuild-all = "sudo nix-collect-garbage --delete-older-than 7d && sudo nixos-rebuild switch"; + }; + }; + }; +} + diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..dc5b74f --- /dev/null +++ b/todo.md @@ -0,0 +1,6 @@ +# To-Do list + +## Figure out how to auto-initialize fish/tide configuration +Could probably read through the tide variable set to figure this out, just haven't done it yet. For now this command should initialize things correctly: + +```tide configure --auto --style=Rainbow --prompt_colors='True color' --show_time='24-hour format' --rainbow_prompt_separators=Vertical --powerline_prompt_heads=Round --powerline_prompt_tails=Flat --powerline_prompt_style='Two lines, character' --prompt_connection=Disconnected --powerline_right_prompt_frame=No --prompt_spacing=Compact --icons='Many icons' --transient=No```