diff --git a/configs/home-manager/alacritty/alacritty.yml b/configs/home-manager/alacritty/alacritty.yml new file mode 100644 index 0000000..5f59b36 --- /dev/null +++ b/configs/home-manager/alacritty/alacritty.yml @@ -0,0 +1,82 @@ +env: + TERM: xterm-256color +history: 30000 +font: + normal: + family: monospace + bold: + family: monospace + italic: + family: monospace + bold_italic: + family: monospace + size: 9.5 +cursor: + text: CellBackground + cursor: CellForeground +vi_mode_cursor: + text: CellBackground + cursor: CellForeground +colors: + primary: + background: "#1E1E2E" # base + foreground: "#CDD6F4" # text + # Bright and dim foreground colors + dim_foreground: "#CDD6F4" # text + bright_foreground: "#CDD6F4" # text + cursor: + text: "#1E1E2E" # base + cursor: "#F5E0DC" # rosewater + vi_mode_cursor: + text: "#1E1E2E" # base + cursor: "#B4BEFE" # lavender + search: + matches: + foreground: "#1E1E2E" # base + background: "#A6ADC8" # subtext0 + focused_match: + foreground: "#1E1E2E" # base + background: "#A6E3A1" # green + footer_bar: + foreground: "#1E1E2E" # base + background: "#A6ADC8" # subtext0 + hints: + start: + foreground: "#1E1E2E" # base + background: "#F9E2AF" # yellow + end: + foreground: "#1E1E2E" # base + background: "#A6ADC8" # subtext0 + selection: + text: "#1E1E2E" # base + background: "#F5E0DC" # rosewater + normal: + black: "#45475A" # surface1 + red: "#F38BA8" # red + green: "#A6E3A1" # green + yellow: "#F9E2AF" # yellow + blue: "#89B4FA" # blue + magenta: "#F5C2E7" # pink + cyan: "#94E2D5" # teal + white: "#BAC2DE" # subtext1 + bright: + black: "#585B70" # surface2 + red: "#F38BA8" # red + green: "#A6E3A1" # green + yellow: "#F9E2AF" # yellow + blue: "#89B4FA" # blue + magenta: "#F5C2E7" # pink + cyan: "#94E2D5" # teal + white: "#A6ADC8" # subtext0 + dim: + black: "#45475A" # surface1 + red: "#F38BA8" # red + green: "#A6E3A1" # green + yellow: "#F9E2AF" # yellow + blue: "#89B4FA" # blue + magenta: "#F5C2E7" # pink + cyan: "#94E2D5" # teal + white: "#BAC2DE" # subtext1 + indexed_colors: + - { index: 16, color: "#FAB387" } + - { index: 17, color: "#F5E0DC" } diff --git a/flake.lock b/flake.lock index f4a09f3..81995f6 100644 --- a/flake.lock +++ b/flake.lock @@ -509,6 +509,21 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1712909959, + "narHash": "sha256-7/5ubuwdEbQ7Z+Vqd4u0mM5L2VMNDsBh54visp27CtQ=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "f58b25254be441cd2a9b4b444ed83f1e51244f1f", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_2", @@ -658,6 +673,7 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-colors": "nix-colors", "nixgl": "nixgl", + "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs", "nixvim": "nixvim", diff --git a/flake.nix b/flake.nix index b0b26ff..43b7383 100644 --- a/flake.nix +++ b/flake.nix @@ -88,12 +88,12 @@ homeConfigurations = flakeLib.mkHomeConfiguration { inherit inputs outputs nixpkgs flakeLib overlays; - vars = vars // {hostName = "wanaheim"; }; + vars = vars // {hostName = "wanaheim";}; system = "x86_64-linux"; } // flakeLib.mkHomeConfiguration { inherit inputs outputs nixpkgs flakeLib overlays; - vars = vars // {hostName = "asgard"; }; + vars = vars // {hostName = "asgard";}; system = "x86_64-linux"; }; } @@ -111,6 +111,7 @@ nix-colors.url = "github:misterio77/nix-colors"; systems.url = "github:nix-systems/default"; flake-parts.url = "github:hercules-ci/flake-parts"; + nixos-hardware.url = "github:nixos/nixos-hardware"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/home-manager/base/default.nix b/modules/home-manager/base/default.nix index fa7fcd4..aa611ad 100644 --- a/modules/home-manager/base/default.nix +++ b/modules/home-manager/base/default.nix @@ -1,7 +1,10 @@ -_: { +{pkgs, ...}: { imports = [ ./news.nix ./nixpkgs.nix ]; - programs.home-manager.enable = true; + # programs.home-manager.enable = true; + home.packages = with pkgs; [ + home-manager + ]; } diff --git a/modules/home-manager/desktop/alacritty/alacritty.nix b/modules/home-manager/desktop/alacritty/alacritty.nix new file mode 100644 index 0000000..6c5b538 --- /dev/null +++ b/modules/home-manager/desktop/alacritty/alacritty.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + home = { + packages = with pkgs; [ + alacritty + ]; + file.alacritty = { + target = ".config/alacritty/alacritty.yml"; + source = ../../../../configs/alacritty/alacritty.yml; + }; + }; +} diff --git a/modules/home-manager/desktop/alacritty/default.nix b/modules/home-manager/desktop/alacritty/default.nix new file mode 100644 index 0000000..c11afc6 --- /dev/null +++ b/modules/home-manager/desktop/alacritty/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./alacritty.nix + ]; + } diff --git a/modules/home-manager/desktop/default.nix b/modules/home-manager/desktop/default.nix index 950a7ab..9a5154b 100644 --- a/modules/home-manager/desktop/default.nix +++ b/modules/home-manager/desktop/default.nix @@ -41,6 +41,7 @@ ./awesome ./rofi ./network-manager-applet + ./alacritty ]; config = lib.mkIf config.desktop.enable { desktop.awesome.enable = lib.mkDefault true; @@ -56,5 +57,6 @@ }; fonts.fontconfig.enable = true; colorScheme = nix-colors.colorSchemes.catppuccin-mocha; + desktop.network-manager.enable = lib.mkDefault true; }; } diff --git a/modules/home-manager/desktop/network-manager-applet/default.nix b/modules/home-manager/desktop/network-manager-applet/default.nix index a092643..40ec9c1 100644 --- a/modules/home-manager/desktop/network-manager-applet/default.nix +++ b/modules/home-manager/desktop/network-manager-applet/default.nix @@ -3,8 +3,13 @@ config, ... }: -lib.mkIf config.desktop.enable { - services = { - network-manager-applet.enable = true; +{ + options = { + desktop.network-manager.enable = lib.mkEnableOption "netowork-manager"; + }; + config = lib.mkIf config.desktop.network-manager.enable { + services = { + network-manager-applet.enable = true; + }; }; } diff --git a/modules/home-manager/user/default.nix b/modules/home-manager/user/default.nix index 6288a5a..77903d8 100644 --- a/modules/home-manager/user/default.nix +++ b/modules/home-manager/user/default.nix @@ -3,5 +3,8 @@ inherit (vars) username homeDirectory; language.base = vars.locale; stateVersion = "23.05"; + sessionVariables = { + EDITOR = "vim"; + }; }; } diff --git a/modules/nixos/base/binary-cache/default.nix b/modules/nixos/base/binary-cache/default.nix new file mode 100644 index 0000000..78cda9c --- /dev/null +++ b/modules/nixos/base/binary-cache/default.nix @@ -0,0 +1,16 @@ +{ + + nix = { + settings = { + substituters = [ + "http://nixcache.odie.intranet" + "https://nix-community.cachix.org" + "https://cache.nixos.org/" + ]; + trusted-public-keys = [ + "nixcache.odie.intranet:hGgFL/QIgirwA8h+FZdwPZKuW/J1xNzH6PEu5CL/OKI=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; + } diff --git a/modules/nixos/base/default.nix b/modules/nixos/base/default.nix index 6be18c3..6558fa8 100644 --- a/modules/nixos/base/default.nix +++ b/modules/nixos/base/default.nix @@ -8,6 +8,7 @@ ./programs ./ssh ./power-management + ./binary-cache ]; config = { diff --git a/modules/nixos/server/binary-cache/default.nix b/modules/nixos/server/binary-cache/default.nix index c96abe7..97e8d57 100644 --- a/modules/nixos/server/binary-cache/default.nix +++ b/modules/nixos/server/binary-cache/default.nix @@ -1,9 +1,11 @@ { lib, config, + vars, ... }: let cfg = config.services.nix-serve; + inherit (vars) domain; in with lib; { config = mkIf cfg.enable { @@ -21,7 +23,7 @@ in nginx = { virtualHosts = { # ... existing hosts config etc. ... - "binarycache.odie.intranet" = { + "nixcache.${domain}" = { locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; }; }; diff --git a/profiles/home-manager/odie@asgard/home.nix b/profiles/home-manager/odie@asgard/home.nix index 6ac00f2..ff200a4 100644 --- a/profiles/home-manager/odie@asgard/home.nix +++ b/profiles/home-manager/odie@asgard/home.nix @@ -1,4 +1,5 @@ { + pkgs, inputs, outputs, ... @@ -29,6 +30,10 @@ }; theme.cursor.enable = false; theme.gtk.enable = false; + home.packages = with pkgs; [ + nix-serve + ]; + desktop.network-manager.enable = false; } ]; } diff --git a/profiles/home-manager/odie@wanaheim/home.nix b/profiles/home-manager/odie@wanaheim/home.nix index eb09101..00102a0 100644 --- a/profiles/home-manager/odie@wanaheim/home.nix +++ b/profiles/home-manager/odie@wanaheim/home.nix @@ -19,6 +19,7 @@ wifi_device = "'wlp3s0'"; battery_device = "'BAT0'"; }; + terminal = "alacritty"; }; services.picom.enable = false; programs.rofi.enable = true; diff --git a/profiles/nixos/wanaheim/configuration.nix b/profiles/nixos/wanaheim/configuration.nix new file mode 100644 index 0000000..17cb53c --- /dev/null +++ b/profiles/nixos/wanaheim/configuration.nix @@ -0,0 +1,27 @@ +{ + inputs, outputs, pkgs, vars, ... +}: { + imports = [ + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t410 + inputs.nur.nixosModules.nur + outputs.nixosModules.base + outputs.nixosModules.desktop + ]; + + networking = { + inherit (vars) hostName domain; + networkmanager.enable = true; + }; + + environment = { + systemPackages = with pkgs; [ + iw + ]; + }; + + programs.zsh.enable = true; + + nixpkgs.hostPlatform = "x86_64-linux"; + + system.stateVersion = "23.05"; +} diff --git a/profiles/nixos/wanaheim/hardware-configuration.nix b/profiles/nixos/wanaheim/hardware-configuration.nix new file mode 100644 index 0000000..70f91ee --- /dev/null +++ b/profiles/nixos/wanaheim/hardware-configuration.nix @@ -0,0 +1,35 @@ +# 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. +{ lib, ... }: + +{ + boot = { + loader.grub.enable = true; + loader.grub.devices = [ + "/dev/sda" + ]; + kernelModules = [ "iwlwifi" ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + "/mnt/media" = { + device = "10.0.10.4:/volume1/media"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" "_netdev" ]; + }; + }; + + # 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"; +}