From bb9ffd0c5bb723592517d434a2f6c7513286b6ab Mon Sep 17 00:00:00 2001 From: willemml Date: Thu, 2 Mar 2023 17:03:54 -0800 Subject: [PATCH] Add flake parts to flake and fix some shortcuts. --- flake.lock | 37 +++++++++++++++++++++++++++++++++++++ flake.nix | 3 ++- home/default.nix | 3 ++- home/programs.nix | 13 +++++++------ 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index 984ab5b..90d68cf 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,24 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1675933616, + "narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "47478a4a003e745402acf63be7f9a092d51b83d7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1676283394, @@ -124,6 +142,24 @@ "type": "indirect" } }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1675183161, + "narHash": "sha256-Zq8sNgAxDckpn7tJo7V1afRSk2eoVbu3OjI1QklGLNg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e1e1b192c1a5aab2960bf0a0bd53a2e8124fa18e", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1676973346, @@ -174,6 +210,7 @@ "root": { "inputs": { "darwin": "darwin", + "flake-parts": "flake-parts", "flake-utils": "flake-utils", "home-manager": "home-manager", "mach-nix": "mach-nix", diff --git a/flake.nix b/flake.nix index 0bbd01a..49ac177 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,11 @@ { - description = "Willem's Darwin configuration"; + description = "Willem's Nix configurations"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; darwin.url = "github:lnl7/nix-darwin"; darwin.inputs.nixpkgs.follows = "nixpkgs"; + flake-parts.url = "github:hercules-ci/flake-parts"; flake-utils.url = "github:numtide/flake-utils"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/default.nix b/home/default.nix index 13c1f14..f9742fd 100644 --- a/home/default.nix +++ b/home/default.nix @@ -34,9 +34,10 @@ rec { ctype = "en_US.UTF-8"; }; sessionVariables = rec { + DOTDIR = "${config.home.homeDirectory}/.config/dotfiles.nix"; EDITOR = emacsCommand; VISUAL = emacsCommand; - ORGDIR = "~/Documents/org"; + ORGDIR = "${config.home.homeDirectory}/Documents/org"; UBCDIR = "${ORGDIR}/ubc"; }; stateVersion = "22.11"; diff --git a/home/programs.nix b/home/programs.nix index 0b5e468..84147d3 100644 --- a/home/programs.nix +++ b/home/programs.nix @@ -32,7 +32,6 @@ enableAliases = true; }; - fzf = { enable = true; defaultCommand = "${pkgs.fd}/bin/fd . ${config.home.homeDirectory}"; @@ -171,19 +170,21 @@ shellAliases = rec { cd = "z"; discord = "${web} https://discord.com/channels/@me"; + dotd = "cd ${config.home.sessionVariables.DOTDIR} "; e = "emacsclient -c -nw"; em = "emacs -nw"; emw = "emacs"; ew = "emacsclient -c"; l = "ls -1"; - nbs = lib.mkIf pkgs.stdenv.isLinux "sudo nixos-rebuild build --flake ${config.home.homeDirectory}/.config/dotfiles.nix#"; np = "nix-shell -p"; - nrs = lib.mkIf pkgs.stdenv.isLinux "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/.config/dotfiles.nix#"; - org = "z ${config.home.sessionVariables.ORGDIR}"; + org = "cd ${config.home.sessionVariables.ORGDIR} "; spotify = "${web} https://open.spotify.com/"; - ubc = "z ${config.home.sessionVariables.UBCDIR}"; + ubc = "cd ${config.home.sessionVariables.UBCDIR} "; web = "${config.programs.firefox.package}/bin/firefox"; - }; + }; #// lib.optionals pkgs.stdenv.isLinux { + #nbs = "sudo nixos-rebuild build --flake ${config.home.sessionVariables.DOTDIR}#"; + # nrs = "sudo nixos-rebuild switch --flake ${config.home.sessionVariables.DOTDIR}#"; + #}; }; home-manager.enable = true;