aboutsummaryrefslogtreecommitdiffstats
path: root/modules/scripts/default.nix
blob: 3802b8273c28b0fb89d6ab898499aac9265d6988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ config, lib, pkgs, ... }:

{
	options.scripts = {
		enable = lib.mkEnableOption "Enable scripts.";
	};

	config = lib.mkIf config.scripts.enable {
		home.file."scripts/restart-network" = {
			source = ./scripts/restart-network.sh;
			executable = true;
		};

		home.file."scripts/home-manager-switch" = {
			text = ''
#!/bin/sh
home-manager switch --flake ${config.baseDirectory}/#${config.home.username}
			'';
			executable = true;
		};
	};
}