diff --git a/base.nix b/base.nix index a0bcbd6..5f8247a 100644 --- a/base.nix +++ b/base.nix @@ -1,15 +1,19 @@ -{ config, lib, pkgs, options, ... }: { +{ config, lib, pkgs, inputs, outputs, ... }: { imports = [ + inputs.home-manager.nixosModules.home-manager ./modules/apps.nix ./modules/dev.nix ./modules/shell.nix ./modules/services.nix ./jawz.nix ]; - system = { - copySystemConfiguration = true; - stateVersion = "23.11"; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + extraSpecialArgs = { inherit inputs outputs; }; + users.jawz = import ./home-manager/default.nix; }; + system.stateVersion = "23.11"; time = { timeZone = "America/Mexico_City"; hardwareClockInLocalTime = true; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ce3ba0f --- /dev/null +++ b/flake.lock @@ -0,0 +1,66 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714043624, + "narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.11", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1714272655, + "narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6342963 --- /dev/null +++ b/flake.nix @@ -0,0 +1,44 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-23.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + home-manager.url = "github:nix-community/home-manager/release-23.11"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs: + let + inherit (self) outputs; + lib = nixpkgs.lib // home-manager.lib; + system = "x86_64-linux"; + makePkgs = repo: + import repo { + inherit system; + config.allowUnfree = true; + }; + pkgs = makePkgs nixpkgs; + pkgsU = makePkgs nixpkgs-unstable; + in { + inherit lib pkgs; + formatter = pkgs.alejandra; + nixosConfigurations = { + workstation = lib.nixosSystem { + inherit system; + modules = [ + ./hosts/workstation/configuration.nix + ({ pkgs, ... }: { + nixpkgs.overlays = [ + (self: super: { + planify = pkgsU.planify; + gdtoolkit = pkgsU.gdtoolkit; + }) + ]; + }) + ]; + specialArgs = { inherit inputs outputs; }; + }; + }; + }; +} diff --git a/home-manager/default.nix b/home-manager/default.nix index c4ecdaf..4ca5870 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,137 +1,131 @@ -{ config, lib, pkgs, ... }: -let - version = "23.11"; - home-manager = builtins.fetchTarball - "https://github.com/nix-community/home-manager/archive/release-${version}.tar.gz"; -in { - imports = [ (import "${home-manager}/nixos") ]; - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - users.jawz = { config, pkgs, ... }: { - home.stateVersion = version; - programs.bash = { - enable = true; - historyFile = "\${XDG_STATE_HOME}/bash/history"; - historyControl = [ "erasedups" "ignorespace" "ignoredups" ]; - shellAliases = { - hh = "hstr"; - ls = "eza --icons --group-directories-first"; - edit = "emacsclient -t"; - comic = ''download -u jawz -i "$(cat $LC | fzf --multi --exact -i)"''; - gallery = - ''download -u jawz -i "$(cat $LW | fzf --multi --exact -i)"''; - cp = "cp -i"; - mv = "mv -i"; - mkdir = "mkdir -p"; - rm = "trash"; - ".." = "cd .."; - "..." = "cd ../.."; - ".3" = "cd ../../.."; - ".4" = "cd ../../../.."; - ".5" = "cd ../../../../.."; - dl = "download -u jawz -i"; - e = "edit"; - c = "cat"; - b = "bat"; - f = "fzf --multi --exact -i"; - sc = "systemctl --user"; - jc = "journalctl --user -xefu"; - open-gallery = '' - cd /mnt/pool/scrapping/JawZ/gallery-dl && - xdg-open "$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"''; - unique-extensions = '' - fd -tf | rev | cut -d. -f1 | rev | - tr '[:upper:]' '[:lower:]' | sort | - uniq --count | sort -rn''; - }; - enableVteIntegration = true; - initExtra = '' - $HOME/.local/bin/pokemon-colorscripts -r --no-title +{ config, lib, pkgs, inputs, outputs, ... }: { + # let + # version = "23.11"; + # home-manager = builtins.fetchTarball + # "https://github.com/nix-community/home-manager/archive/release-${version}.tar.gz"; + # in { + # imports = [ (import "${home-manager}/nixos") ]; + home.stateVersion = "23.11"; - list_root="${config.xdg.configHome}"/jawz/lists/jawz - export LW=$list_root/watch.txt - export LI=$list_root/instant.txt - export LC=$list_root/comic.txt - export command_timeout=60 + programs.bash = { + enable = true; + historyFile = "\${XDG_STATE_HOME}/bash/history"; + historyControl = [ "erasedups" "ignorespace" "ignoredups" ]; + shellAliases = { + hh = "hstr"; + ls = "eza --icons --group-directories-first"; + edit = "emacsclient -t"; + comic = ''download -u jawz -i "$(cat $LC | fzf --multi --exact -i)"''; + gallery = ''download -u jawz -i "$(cat $LW | fzf --multi --exact -i)"''; + cp = "cp -i"; + mv = "mv -i"; + mkdir = "mkdir -p"; + rm = "trash"; + ".." = "cd .."; + "..." = "cd ../.."; + ".3" = "cd ../../.."; + ".4" = "cd ../../../.."; + ".5" = "cd ../../../../.."; + dl = "download -u jawz -i"; + e = "edit"; + c = "cat"; + b = "bat"; + f = "fzf --multi --exact -i"; + sc = "systemctl --user"; + jc = "journalctl --user -xefu"; + open-gallery = '' + cd /mnt/pool/scrapping/JawZ/gallery-dl && + xdg-open "$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"''; + unique-extensions = '' + fd -tf | rev | cut -d. -f1 | rev | + tr '[:upper:]' '[:lower:]' | sort | + uniq --count | sort -rn''; + }; + enableVteIntegration = true; + initExtra = '' + $HOME/.local/bin/pokemon-colorscripts -r --no-title - if command -v fzf-share >/dev/null; then - source "$(fzf-share)/key-bindings.bash" - source "$(fzf-share)/completion.bash" - fi + list_root="${config.xdg.configHome}"/jawz/lists/jawz + export LW=$list_root/watch.txt + export LI=$list_root/instant.txt + export LC=$list_root/comic.txt + export command_timeout=60 - nixos-reload () { - NIXOSDIR=/home/jawz/Development/NixOS - # nix-store --add-fixed sha256 \ - # $NIXOSDIR/PureRef-1.11.1_x64.Appimage - fd --full-path $NIXOSDIR -e nix -x nixfmt \; - sudo unbuffer nixos-rebuild switch -I \ - nixos-config="$NIXOSDIR/hosts/$HOSTNAME/configuration.nix" \ - |& nom - } - ''; - }; - xdg = { - enable = true; - userDirs = { - enable = true; - createDirectories = false; - desktop = "${config.home.homeDirectory}"; - documents = "${config.home.homeDirectory}/Documents"; - download = "${config.home.homeDirectory}/Downloads"; - music = "${config.home.homeDirectory}/Music"; - pictures = "${config.home.homeDirectory}/Pictures"; - templates = "${config.xdg.dataHome}/Templates"; - videos = "${config.home.homeDirectory}/Videos"; - }; - configFile = { - "wgetrc".source = ../dotfiles/wget/wgetrc; - "configstore/update-notifier-npm-check.json".source = - ../dotfiles/npm/update-notifier-npm-check.json; - "npm/npmrc".source = ../dotfiles/npm/npmrc; - "gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json; - "htop/htoprc".source = ../dotfiles/htop/htoprc; - "python/pythonrc".source = ../dotfiles/pythonrc; - }; - }; - programs = { - helix = { enable = true; }; - hstr.enable = true; - zoxide = { - enable = true; - enableBashIntegration = true; - }; - direnv = { - enable = true; - enableBashIntegration = true; - nix-direnv.enable = true; - }; - bat = { - enable = true; - config = { - pager = "less -FR"; - theme = "base16"; - }; - extraPackages = with pkgs.bat-extras; [ - batman # man pages - batpipe # piping - batgrep # ripgrep - batdiff # this is getting crazy! - batwatch # probably my next best friend - prettybat # trans your sourcecode! - ]; - }; - git = { - enable = true; - userName = "Danilo Reyes"; - userEmail = "CaptainJawZ@protonmail.com"; - }; - htop = { - enable = true; - package = pkgs.htop-vim; - }; - }; - services = { lorri.enable = true; }; + if command -v fzf-share >/dev/null; then + source "$(fzf-share)/key-bindings.bash" + source "$(fzf-share)/completion.bash" + fi + + nixos-reload () { + NIXOSDIR=/home/jawz/Development/NixOS + # nix-store --add-fixed sha256 \ + # $NIXOSDIR/PureRef-1.11.1_x64.Appimage + fd --full-path $NIXOSDIR -e nix -x nixfmt \; + sudo unbuffer nixos-rebuild switch -I \ + nixos-config="$NIXOSDIR/hosts/$HOSTNAME/configuration.nix" \ + |& nom + } + ''; + }; + xdg = { + enable = true; + userDirs = { + enable = true; + createDirectories = false; + desktop = "${config.home.homeDirectory}"; + documents = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Music"; + pictures = "${config.home.homeDirectory}/Pictures"; + templates = "${config.xdg.dataHome}/Templates"; + videos = "${config.home.homeDirectory}/Videos"; + }; + configFile = { + "wgetrc".source = ../dotfiles/wget/wgetrc; + "configstore/update-notifier-npm-check.json".source = + ../dotfiles/npm/update-notifier-npm-check.json; + "npm/npmrc".source = ../dotfiles/npm/npmrc; + "gallery-dl/config.json".source = ../dotfiles/gallery-dl/config.json; + "htop/htoprc".source = ../dotfiles/htop/htoprc; + "python/pythonrc".source = ../dotfiles/pythonrc; }; }; + programs = { + helix = { enable = true; }; + hstr.enable = true; + zoxide = { + enable = true; + enableBashIntegration = true; + }; + direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; + bat = { + enable = true; + config = { + pager = "less -FR"; + theme = "base16"; + }; + extraPackages = with pkgs.bat-extras; [ + batman # man pages + batpipe # piping + batgrep # ripgrep + batdiff # this is getting crazy! + batwatch # probably my next best friend + prettybat # trans your sourcecode! + ]; + }; + git = { + enable = true; + userName = "Danilo Reyes"; + userEmail = "CaptainJawZ@protonmail.com"; + }; + htop = { + enable = true; + package = pkgs.htop-vim; + }; + }; + services = { lorri.enable = true; }; } diff --git a/hosts/workstation/configuration.nix b/hosts/workstation/configuration.nix index 68e2fdb..fbfbb1e 100644 --- a/hosts/workstation/configuration.nix +++ b/hosts/workstation/configuration.nix @@ -10,7 +10,6 @@ in { ./hardware-configuration.nix ../../base.nix ../../gnome.nix - ../../home-manager/default.nix # ../../services/systemd-user/tasks.nix ]; my = { diff --git a/hosts/workstation/hardware-configuration.nix b/hosts/workstation/hardware-configuration.nix index c8c510e..072ce3b 100644 --- a/hosts/workstation/hardware-configuration.nix +++ b/hosts/workstation/hardware-configuration.nix @@ -1,5 +1,6 @@ { config, pkgs, modulesPath, lib, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + nixpkgs.hostPlatform = "x86_64-linux"; hardware = { cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/modules/apps/art.nix b/modules/apps/art.nix index ad7b96f..a3583dd 100644 --- a/modules/apps/art.nix +++ b/modules/apps/art.nix @@ -1,10 +1,4 @@ -{ config, lib, pkgs, ... }: -let - unstable = import - (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { - config = config.nixpkgs.config; - }; -in { +{ config, lib, pkgs, ... }: { options.my = { apps.art.enable = lib.mkEnableOption "enable"; dev.gameDev.enable = lib.mkEnableOption "enable"; @@ -22,7 +16,7 @@ in { blender # cgi animation and sculpting ]) ++ (if config.my.dev.gameDev.enable then [ godot_4 # game development - unstable.gdtoolkit # gdscript language server + gdtoolkit # gdscript language server ] else [ ]); }; diff --git a/modules/apps/gaming.nix b/modules/apps/gaming.nix index 3e0093e..498ebe9 100644 --- a/modules/apps/gaming.nix +++ b/modules/apps/gaming.nix @@ -1,10 +1,4 @@ -{ config, lib, pkgs, ... }: -let - unstable = import - (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { - config = config.nixpkgs.config; - }; -in { +{ config, lib, pkgs, ... }: { options.my.apps.gaming.enable = lib.mkEnableOption "enable"; config = lib.mkIf config.my.apps.gaming.enable { programs.steam = { diff --git a/modules/apps/office.nix b/modules/apps/office.nix index 19efe90..8ffe210 100644 --- a/modules/apps/office.nix +++ b/modules/apps/office.nix @@ -1,10 +1,4 @@ -{ config, lib, pkgs, ... }: -let - unstable = import - (builtins.fetchTarball "https://github.com/nixos/nixpkgs/tarball/master") { - config = config.nixpkgs.config; - }; -in { +{ config, lib, pkgs, ... }: { options.my.apps.office.enable = lib.mkEnableOption "enable"; config = lib.mkIf config.my.apps.office.enable { users.users.jawz.packages = with pkgs; ([ @@ -12,7 +6,7 @@ in { calibre # ugly af eBook library manager newsflash # feed reader, syncs with nextcloud furtherance # I packaged this one tehee track time utility - unstable.planify # let's pretend I will organize my tasks + planify # let's pretend I will organize my tasks # foliate # gtk eBook reader # wike # gtk wikipedia wow! # denaro # manage your finances