From fce0937a2eb30a4796b9ecf9934f600e039366ff Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 24 Jan 2023 12:09:22 -0600 Subject: [PATCH] WIP --- Makefile | 2 +- flake.nix | 13 +-- generating-rune.sh | 32 +++++-- {modules => hosts/jeran}/configuration.nix | 30 +++--- hosts/jeran/motd | 12 +++ modules/configuration.nix.bak | 103 +++++++++++++++++++++ modules/environment.nix | 19 ++-- 7 files changed, 170 insertions(+), 41 deletions(-) rename {modules => hosts/jeran}/configuration.nix (66%) create mode 100644 hosts/jeran/motd create mode 100644 modules/configuration.nix.bak diff --git a/Makefile b/Makefile index aa78481..2c887f6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ## switch | perform nixos rebuild switch: - sudo nixos-rebuild switch --flake . --impure + sudo nixos-rebuild switch --flake . ## lint | format *.nix lint: diff --git a/flake.nix b/flake.nix index 728aee3..db8b6bb 100644 --- a/flake.nix +++ b/flake.nix @@ -18,13 +18,14 @@ ./modules/environment.nix ]; }; - jeran = inputs.nixpkgs.lib.nixosSystem { -system = "x86_64-linux"; -modules = [ - ./modules/configuration.nix + jeran = inputs.nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/jeran/configuration.nix ./modules/environment.nix -]; + ]; + specialArgs = { inherit inputs; }; + }; }; }; -}; } diff --git a/generating-rune.sh b/generating-rune.sh index 5946d2f..34e4ce6 100755 --- a/generating-rune.sh +++ b/generating-rune.sh @@ -1,17 +1,31 @@ #!/usr/bin/env bash set -e +declare -A IMG_SRC +IMG_SRC=( + [jeran]=https://upload.wikimedia.org/wikipedia/commons/0/01/Runic_letter_jeran.png + [othalan]=https://upload.wikimedia.org/wikipedia/commons/1/16/Runic_letter_othalan.png +) -# rune=$1 -rune=othalan -# color=${36:$2} -# color=${36:$2} -color=36 + +if [[ $# -eq 0 ]]; then + echo please provide rune name + echo options: + for i in "${!IMG_SRC[@]}";do + echo $i + done + exit 1 +fi + +rune=$1 +echo $2 +color=${36:-$2} + +# tmp this? FILENAME="Runic_letter_${rune}.png" -IMAGE_URL="https://upload.wikimedia.org/wikipedia/commons/1/16/Runic_letter_othalan.png" -echo "$IMAGE_URL" -wget "$IMAGE_URL" + +wget -O $FILENAME "${IMG_SRC[$rune]}" printf "\033[1;%dm\n%s\033[0m \033[1m%s\033[0m\n\n" \ "$color" \ - "$(ascii-image-converter "$FILENAME" -n -H 18)" \ + "$(ascii-image-converter "$FILENAME" -n -H 10 -b)" \ "$rune" \ >"${rune}.txt" diff --git a/modules/configuration.nix b/hosts/jeran/configuration.nix similarity index 66% rename from modules/configuration.nix rename to hosts/jeran/configuration.nix index bf0775e..9e772be 100644 --- a/modules/configuration.nix +++ b/hosts/jeran/configuration.nix @@ -1,18 +1,19 @@ -{ lib, config, pkgs, ... }: +{ inputs, lib, config, pkgs, ... }: { + # TODO: put in hardware-configuration.nix imports = [ - + "${inputs.nixpkgs}/nixos/modules/virtualisation/google-compute-image.nix" ]; security.sudo.wheelNeedsPassword = false; - - users.defaultUserShell = pkgs.zsh; -users.extraUsers.daylin = { -isNormalUser = true; -extraGroups = ["wheel" "docker"]; -useDefaultShell = true; -}; + users.motd = (builtin.readFile "motd"); + users.defaultUserShell = pkgs.zsh; + users.extraUsers.daylin = { + isNormalUser = true; + extraGroups = [ "wheel" "docker" ]; + useDefaultShell = true; + }; services.openssh.passwordAuthentication = true; - + services.resolved.enable = true; system.stateVersion = "22.11"; nixpkgs.config.allowUnfree = true; @@ -27,14 +28,13 @@ useDefaultShell = true; programs.zsh.enable = true; programs.nix-ld.enable = true; virtualisation.docker.enable = true; - + environment.systemPackages = with pkgs; [ zsh tmux wget unzip - htop less gnumake gcc @@ -48,18 +48,18 @@ useDefaultShell = true; atuin # sheldon chezmoi - + fzf delta ripgrep - lsd + lsd gh lazygit nixpkgs-fmt - nodejs + nodejs go rustup ]; diff --git a/hosts/jeran/motd b/hosts/jeran/motd new file mode 100644 index 0000000..f8da967 --- /dev/null +++ b/hosts/jeran/motd @@ -0,0 +1,12 @@ + +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⣠⣾⠆⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⣠⡾⠋⠁⠀⠀⠀⠀⠀⠀⠀ +⠀⠀⠺⣯⡀⠀⠸⣷⣄⠀⠀⠀⠀⠀ +⠀⠀⠀⠈⠻⣦⡀⠈⠙⢷⣄⠀⠀⠀ +⠀⠀⠀⠀⠀⠈⠻⠃⠀⣠⣿⠇⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⣠⣾⠟⠁⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠘⠋⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ jeran + diff --git a/modules/configuration.nix.bak b/modules/configuration.nix.bak new file mode 100644 index 0000000..33fcbf8 --- /dev/null +++ b/modules/configuration.nix.bak @@ -0,0 +1,103 @@ +{ lib, config, pkgs, ... }: + +{ + imports = + [ + + ]; + + nixpkgs.config.allowUnfree = true; + + nix.package = pkgs.nixUnstable; + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + boot.kernelPackages = pkgs.linuxPackages_latest; + + virtualisation.virtualbox.guest.enable = true; + networking.hostName = "nixos-vm"; # Define your hostname. + + time.timeZone = "America/Chicago"; + + programs.zsh.enable = true; + + programs.nix-ld.enable = true; + + services.xserver = { + enable = true; + displayManager.startx.enable = true; + displayManager.sddm.enable = lib.mkForce false; + + displayManager.autoLogin.enable = lib.mkForce false; + windowManager.qtile.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users = { + defaultUserShell = pkgs.zsh; + users.daylin = { + shell = pkgs.zsh; + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + }; + }; + + fonts.fonts = with pkgs; [ + noto-fonts + noto-fonts-emoji + noto-fonts-extra + (nerdfonts.override { fonts = [ "FiraCode" "FiraMono" ]; }) + ]; + + + environment.systemPackages = with pkgs; [ + fuse + zsh + + wget + unzip + less + gnumake + gcc + + git + + vim + neovim + starship + chezmoi + fzf + delta + gh + + nixpkgs-fmt + + xdotool + wezterm + eww + rofi + dunst + feh + + picom + gtk3 + + gnome.adwaita-icon-theme + gnome.gnome-settings-daemon + catppuccin-gtk + + wavebox + + pciutils + (vivaldi.override { + proprietaryCodecs = true; + enableWidevine = false; + commandLineArgs = "--force-dark-mode"; + }) + + vscode.fhs + + go + rustup + ]; +} diff --git a/modules/environment.nix b/modules/environment.nix index 84c2c41..305ea72 100644 --- a/modules/environment.nix +++ b/modules/environment.nix @@ -8,14 +8,13 @@ issue.source = ../etc/issue; }; - environment.variables = { - NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ - stdenv.cc.cc - openssl - - zlib # for delta - ]; - NIX_LD = lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"; - }; - + # # environment.variables = { + # # NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ + # # stdenv.cc.cc + # # openssl + # # + # # zlib # for delta + # # ]; + # # NIX_LD = lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"; + # # }; }