diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2025-12-28 16:59:21 -0600 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2025-12-28 16:59:21 -0600 |
| commit | eaa11cebcb15aa76c9ef10b539ac3dc412c50ff8 (patch) | |
| tree | 0b7be7305e210c0c4b5984c55659c6278d01d22e | |
| parent | 182f10a725e154d46069213ad709711f83c7c57a (diff) | |
| download | nixos-eaa11cebcb15aa76c9ef10b539ac3dc412c50ff8.tar.xz nixos-eaa11cebcb15aa76c9ef10b539ac3dc412c50ff8.zip | |
reposync
| -rw-r--r-- | archetypes/profiles/desktop/default.nix | 5 | ||||
| -rw-r--r-- | flake.lock | 21 | ||||
| -rw-r--r-- | flake.nix | 5 | ||||
| -rw-r--r-- | home-manager/default.nix | 1 | ||||
| -rw-r--r-- | home-manager/resources/activation-scripts/clone-repos.sh | 19 | ||||
| -rw-r--r-- | users/timmy/default.nix | 6 | ||||
| -rw-r--r-- | users/timmy/repos.nix | 48 |
7 files changed, 75 insertions, 30 deletions
diff --git a/archetypes/profiles/desktop/default.nix b/archetypes/profiles/desktop/default.nix index 6c5d509..8f66693 100644 --- a/archetypes/profiles/desktop/default.nix +++ b/archetypes/profiles/desktop/default.nix @@ -108,11 +108,6 @@ #polkit-gnome.enable = mkDesktop true; # Doesn't work on X }; - home._repos = { - enable = mkDesktop true; - desktop = mkDesktop true; - }; - xdg = { autostart = { enable = mkDesktop true; @@ -149,11 +149,32 @@ "type": "github" } }, + "reposync": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1766962512, + "narHash": "sha256-7vdRCqpsXGnZNOOujznFwO7435A45JXyl1d1OPXd/Fc=", + "ref": "refs/heads/master", + "rev": "16d918ac65bd9bc6de8cf2b35e9389f767442d04", + "revCount": 4, + "type": "git", + "url": "https://git.tjkeller.xyz/hm-reposync" + }, + "original": { + "type": "git", + "url": "https://git.tjkeller.xyz/hm-reposync" + } + }, "root": { "inputs": { "arkenfox": "arkenfox", "home-manager": "home-manager", "nixpkgs": "nixpkgs_2", + "reposync": "reposync", "sops-nix": "sops-nix" } }, @@ -16,6 +16,10 @@ rec { url = "github:dwarfmaster/arkenfox-nixos"; inputs.nixpkgs.follows = "nixpkgs"; }; + reposync = { + url = "git+https://git.tjkeller.xyz/hm-reposync"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { nixpkgs, ... }@inputs: let @@ -42,6 +46,7 @@ rec { useUserPackages = true; sharedModules = [ inputs.arkenfox.hmModules.arkenfox + inputs.reposync.hmModules.reposync ./home-manager ]; }; diff --git a/home-manager/default.nix b/home-manager/default.nix index c1a105f..2e1ed72 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./clone-repos.nix ./firefox.nix ./fontconfig.nix ./home-cleanup.nix diff --git a/home-manager/resources/activation-scripts/clone-repos.sh b/home-manager/resources/activation-scripts/clone-repos.sh deleted file mode 100644 index adf8fd7..0000000 --- a/home-manager/resources/activation-scripts/clone-repos.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -clonemissing() { - # pull and return if already existing - if [ -d "$2"/.git ]; then - run cd $VERBOSE_ARG "$2" - run git pull $VERBOSE_ARG || echo "$2: failed to pull from remote" - return - fi - - # clone $1 to $2 - run mkdir -p $VERBOSE_ARG "$2" - run git clone $VERBOSE_ARG "$1" "$2" - - # link files to $3 - [ -z "$3" ] && return - run mkdir -p $VERBOSE_ARG "$3" - run ln -sf $VERBOSE_ARG "$2"/* "$3" -} diff --git a/users/timmy/default.nix b/users/timmy/default.nix index e118395..e3950bc 100644 --- a/users/timmy/default.nix +++ b/users/timmy/default.nix @@ -24,6 +24,7 @@ in { ./localization.nix ./nas.nix ./printing.nix + ./repos.nix ./user.nix ./wifi.nix ]; @@ -115,11 +116,6 @@ in { }; }; - # Clone repos - home._repos = { - enable = true; - }; - # Setup gtk bookmarks gtk.gtk3.bookmarks = ( lib.mapAttrsToList (name: dir: diff --git a/users/timmy/repos.nix b/users/timmy/repos.nix new file mode 100644 index 0000000..eed0219 --- /dev/null +++ b/users/timmy/repos.nix @@ -0,0 +1,48 @@ +{ config, ... }: let + server = "https://git.tjkeller.xyz/"; + # TODO find how to get home manager config instead of nixos config + #srcHome = "${config.xdg.userDirs.documents}/src"; + #configHome = config.xdg.configHome; + home = "/home/timmy"; + srcHome = "${home}/docs/src"; + configHome = "${home}/.config"; +in { + config = { + home-manager.users.timmy = { + reposync.enable = true; + reposync.outOfStoreGitRepository = { + config = { + inherit server; + repository = "dotconfig"; + targetPrefix = srcHome; + stow.".".targetPrefix = configHome; + }; + nixos = { + inherit server; + targetPrefix = srcHome; + }; + scripts = { + inherit server; + targetPrefix = srcHome; + stow."*".target = ".local/bin"; + }; + userscripts = { + inherit server; + targetPrefix = srcHome; + }; + awesome = { + inherit server; + targetPrefix = configHome; + }; + nvim = { + inherit server; + targetPrefix = configHome; + }; + zsh = { + inherit server; + targetPrefix = configHome; + }; + }; + }; + }; +} |
