{"id":16344043,"url":"https://github.com/daru-san/useful-scripts","last_synced_at":"2025-11-06T19:30:28.083Z","repository":{"id":209026701,"uuid":"723044308","full_name":"Daru-san/useful-scripts","owner":"Daru-san","description":"My custom Linux scripts repo","archived":false,"fork":false,"pushed_at":"2024-01-05T15:19:05.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-05T15:27:33.666Z","etag":null,"topics":["linux","nix-flake","nixos","script","unix"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Daru-san.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-24T14:45:57.000Z","updated_at":"2024-01-06T16:26:54.774Z","dependencies_parsed_at":"2023-11-24T16:28:04.688Z","dependency_job_id":"d0fd8247-6d1d-4df8-bcb7-3bd8e47510ed","html_url":"https://github.com/Daru-san/useful-scripts","commit_stats":null,"previous_names":["daru-san/nix-scripts","daru-san/useful-scripts"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daru-san%2Fuseful-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daru-san%2Fuseful-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daru-san%2Fuseful-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daru-san%2Fuseful-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daru-san","download_url":"https://codeload.github.com/Daru-san/useful-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239501387,"owners_count":19649445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","nix-flake","nixos","script","unix"],"created_at":"2024-10-11T00:26:40.464Z","updated_at":"2025-11-06T19:30:28.027Z","avatar_url":"https://github.com/Daru-san.png","language":"Shell","readme":"_**This repo has been archived, go to [Nix-Scripts](https://git.sr.ht/~darumaka/Nix-Scripts)** on sourcehut_\n\n# Outdated\nEverything beyond this point is outdated, development has been moved to the sourcehut repo\n\n# Useful Scripts\nMy personal repo for the scripts I use on my Linux systems.\n\n# Scripts\n\n## Nix-Rebuild\nThis script makes building NixOS configurations simpler and more streamlined by simplifying the syntax\n### Options\nFor normal users\nMain, available for flake and non-flake users\n\n```\nS - switch\nB - build\nv - verbose output\ne - extra options e.g --version\nt - enable show-trace option which helps with debugging and testing\ni - enable the impure flag\nd - use the --dry-run flag\n```\n\nFor flake users\n```\nF - enable flakes\nr - the repo which the flake.nix file is stored in, if not specified will check current directory. You must use either the auto flag or this flag\nu - update packages, specifically updates all flake inputs in the flake.nix file\na - auto mode, uses your current directory and sets a default userstring\nn - specify your hostname, can be used with auto mode\nupdate-inputs - update specific inputs if you only want to update one but not the other\n```\n### Example\n```bash\n# This will build the NixOS configuration using flakes\nnix-rebuild -Si -Fa\n# Same as\nnix flake update --commit-lock-file\nsudo nixos-rebuild switch --flake .#hostname --impure\n```\n### Dependencies\n- nix\n#### Note\nThis script is solely made for NixOS users and cannot be used on other distros without some extreme modification\n\n## Home-Build\nI wrote this script to make building home manager configurations easier and faster with easy to remember and learn options.\n\n### Options\nMain, available for flake and non-flake users\n\n```\nS - switch\nB - build\nb - backup conflicting files\nv - verbose output\ne - extra options e.g --version\nt - enable show-trace option which helps with debugging and testing\ni - enable the impure flag\nd - use the --dry-run flag\n```\n\nFor flake users\n```\nF - enable flakes\nr - the repo which the flake.nix file is stored in, if not specified will check current directory\nu - update packages, specifically updates all flake inputs in the flake.nix file\na - auto mode, uses your current directory and sets a default userstring\nn - specify your userstring, can be used with auto mode\nupdate-inputs - update specific inputs if you only want to update one but not the other\n```\n### Examples\n\nMinimal example\n```bash\n# In this example\nhm-build -Sb\n\n# Is the same as\nhome-manager switch -b hmbak\n```\n\nMaximal example, using flakes\n\u003c!--- \n   Is maximal even a word? \n---\u003e\n```bash\n# In this example\nhm-build -Sivbtd -Fau\n \n# Is the same as\n# It will check if the current directory has a flake.nix file\nnix-flake update --commit-lock-file\nhome-manager switch --flake .#user@hostname --verbose --dry-run -b backup --impure --show-trace\n```\n#### For flake users, these also apply to nix-rebuild:\nSpecify a repo using -r\n```bash\nhm-build -S -Fr ~/repo\n\n#You have to use this if you're not going to use -r, it will use the current directory:\n# -a is for auto mode\nhm-build -S -Fa\n```\n\nSpecify your userstring using\n```bash\n# This will take the hostname and username you specify and use it instead of the defaults for your system\nhm-build -S -Fan user@hostname\n```\n\n\n\u003c!---\nIf you'd like to update individual inputs on a flake based system you can do this\n```bash\n# Instead of using\nhm-build -S -Fur ~/repo\n\n# Use the update-inputs flag and list the individual inputs you'd like to update\n# List the inputs seperated by commas\nhm-build -S -Fr repo --update-inputs nixpkgs,home-manager,ags\n\n# note that using -u and --update-inputs together just updates all inputs anyway\n```\n---\u003e\n\n### Dependancies\n- nix\n- home-manager\n\n#### Notes\nIt will work on most distros in theory, I'm not so sure about in practice but I'm sure it should work\n\n## color picker\nThis script uses hyprpicker to pick a color from the screen. Using wl-clipboard's tools wl-copy and wl-paste to copy the color code in #AABBCC format to the clipboard and notify-send to to notify of the completed operation. All in less than 5 seconds!\n### Dependancies\n- hyprpicker\n- wl-clipboard\n- libnotify\n\n\n# Installation\n\n## The flake, for nix users\n\nYou can add this to your flake.nix inputs\n```nix\n{\n  inputs = {\n    useful-scripts = {\n      url = \"github:Daru-san/useful-scripts\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n   };\n }\n```\nInstall on nix\n```nix\n{ pkgs, inputs }:{\n  environment.systemPackges = [\n    inputs.useful-scripts.packages.${pkgs.system}.hm-build\n    inputs.useful-scripts.packages.${pkgs.system}.color-picker\n   ];\n}\n```\nInstall on home manager\n```nix\n{ pkgs, inputs }:{\n  home.packages = [\n    inputs.useful-scripts.packages.${pkgs.system}.hm-build\n    inputs.useful-scripts.packages.${pkgs.system}.color-picker\n  ];\n}\n```\n\n## TODO\n- [x] Create flake packages\n- [x] Update nix-rebuild\n- [x] Make docs\n- [ ] Finish hm-build and nix-rebuild flake inputs\n- [x] Update hm-build and nix-rebuild flake options\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaru-san%2Fuseful-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaru-san%2Fuseful-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaru-san%2Fuseful-scripts/lists"}