Compare commits
5 Commits
bf51938c80
...
c94b70a45c
| Author | SHA1 | Date | |
|---|---|---|---|
| c94b70a45c | |||
| f55f7f6337 | |||
| 863b742ead | |||
| cd8648da89 | |||
| 18006d96ea |
11
README.md
11
README.md
@@ -2,13 +2,20 @@ Config for my computers.
|
|||||||
|
|
||||||
## Common operations
|
## Common operations
|
||||||
|
|
||||||
Update computer from my configuration:
|
Update computer and home from my configuration:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd ~/dotfiles
|
||||||
|
nix-deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
Advanced: computer only:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo darwin-rebuild switch --flake .
|
sudo darwin-rebuild switch --flake .
|
||||||
```
|
```
|
||||||
|
|
||||||
Update home from my configuration:
|
Advanced: home only:
|
||||||
|
|
||||||
```
|
```
|
||||||
home-manager switch --flake .
|
home-manager switch --flake .
|
||||||
|
|||||||
129
flake.lock
generated
129
flake.lock
generated
@@ -6,20 +6,20 @@
|
|||||||
"fw_nix": "fw_nix",
|
"fw_nix": "fw_nix",
|
||||||
"git-hooks": "git-hooks_2",
|
"git-hooks": "git-hooks_2",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
"jail-nix": "jail-nix",
|
||||||
"nix-homebrew": "nix-homebrew",
|
"nix-homebrew": "nix-homebrew",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixpkgs-screen": "nixpkgs-screen",
|
|
||||||
"systems": "systems_2",
|
"systems": "systems_2",
|
||||||
"vscode-server": "vscode-server"
|
"vscode-server": "vscode-server"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774784938,
|
"lastModified": 1778254862,
|
||||||
"narHash": "sha256-Chh4AxbE8iygGnNdUhuTULTvXod+kUFjJTpF0PN5g68=",
|
"narHash": "sha256-wCDA9iYoZJg+bhkYpsQI1yYdHxHI9RVEtOn+C69sQlg=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "8c375d0a995973abec7670c07e06ec0d6c95004f",
|
"rev": "ce75ee402463b9e617bc5a6b0a39c44754f2f428",
|
||||||
"revCount": 472,
|
"revCount": 519,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/dotdoom/dotfiles.git"
|
"url": "https://github.com/dotdoom/dotfiles.git"
|
||||||
},
|
},
|
||||||
@@ -31,16 +31,16 @@
|
|||||||
"brew-src": {
|
"brew-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774235677,
|
"lastModified": 1776478798,
|
||||||
"narHash": "sha256-0ryNYmzDAeRlrzPTAgmzGH/Cgc8iv/LBN6jWGUANvIk=",
|
"narHash": "sha256-ERStG27tf83VbCfYMxtDSs+sa8FUMJ/3jSu/QfX9rKE=",
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"rev": "894a3d23ac0c8aaf561b9874b528b9cb2e839201",
|
"rev": "3aae056b8d072624255bc8fd27febb7f327b2265",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"ref": "5.1.1",
|
"ref": "5.1.7",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -48,16 +48,16 @@
|
|||||||
"brew-src_2": {
|
"brew-src_2": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774235677,
|
"lastModified": 1778146321,
|
||||||
"narHash": "sha256-0ryNYmzDAeRlrzPTAgmzGH/Cgc8iv/LBN6jWGUANvIk=",
|
"narHash": "sha256-HeBwuJmuBioZHyZqDOcf7W/xsMFupSD583v6I5Cl7a8=",
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"rev": "894a3d23ac0c8aaf561b9874b528b9cb2e839201",
|
"rev": "af835384ac574f76025adb38b292b04cecee1f1f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "Homebrew",
|
"owner": "Homebrew",
|
||||||
"ref": "5.1.1",
|
"ref": "5.1.10",
|
||||||
"repo": "brew",
|
"repo": "brew",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -70,11 +70,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773000227,
|
"lastModified": 1775037210,
|
||||||
"narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
|
"narHash": "sha256-KM2WYj6EA7M/FVZVCl3rqWY+TFV5QzSyyGE2gQxeODU=",
|
||||||
"owner": "nix-darwin",
|
"owner": "nix-darwin",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
|
"rev": "06648f4902343228ce2de79f291dd5a58ee12146",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -90,11 +90,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1773000227,
|
"lastModified": 1777780666,
|
||||||
"narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
|
"narHash": "sha256-8wURyQMdDkGUarSTKOGdCuFfYiwa3HbzwscUfn3STDE=",
|
||||||
"owner": "nix-darwin",
|
"owner": "nix-darwin",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
|
"rev": "8c62fba0854ba15c8917aed18894dbccb48a3777",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -195,11 +195,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774734717,
|
"lastModified": 1777495133,
|
||||||
"narHash": "sha256-mmIc5ZA+hWt9IfZolKOSFEHQc0//dNei3hy7V8yblCg=",
|
"narHash": "sha256-Z7V7cMUSy+fVvQ6QcrhmoWGaXPyMwtkodgBCvrNECBA=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "581b0c951d83f25a532cea8209eb302c18c7a826",
|
"rev": "664d57208441a1ce3738efff83e912122e8d52c6",
|
||||||
"revCount": 13,
|
"revCount": 22,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/futureware-tech/nix.git"
|
"url": "https://github.com/futureware-tech/nix.git"
|
||||||
},
|
},
|
||||||
@@ -217,11 +217,11 @@
|
|||||||
"systems": "systems_4"
|
"systems": "systems_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774734717,
|
"lastModified": 1777495133,
|
||||||
"narHash": "sha256-mmIc5ZA+hWt9IfZolKOSFEHQc0//dNei3hy7V8yblCg=",
|
"narHash": "sha256-Z7V7cMUSy+fVvQ6QcrhmoWGaXPyMwtkodgBCvrNECBA=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "581b0c951d83f25a532cea8209eb302c18c7a826",
|
"rev": "664d57208441a1ce3738efff83e912122e8d52c6",
|
||||||
"revCount": 13,
|
"revCount": 22,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/futureware-tech/nix.git"
|
"url": "https://github.com/futureware-tech/nix.git"
|
||||||
},
|
},
|
||||||
@@ -264,11 +264,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774104215,
|
"lastModified": 1776796298,
|
||||||
"narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=",
|
"narHash": "sha256-PcRvlWayisPSjd0UcRQbhG8Oqw78AcPE6x872cPRHN8=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "f799ae951fde0627157f40aec28dec27b22076d0",
|
"rev": "3cfd774b0a530725a077e17354fbdb87ea1c4aad",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -309,11 +309,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774104215,
|
"lastModified": 1776796298,
|
||||||
"narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=",
|
"narHash": "sha256-PcRvlWayisPSjd0UcRQbhG8Oqw78AcPE6x872cPRHN8=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "f799ae951fde0627157f40aec28dec27b22076d0",
|
"rev": "3cfd774b0a530725a077e17354fbdb87ea1c4aad",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -418,11 +418,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774007980,
|
"lastModified": 1777476904,
|
||||||
"narHash": "sha256-FOnZjElEI8pqqCvB6K/1JRHTE8o4rer8driivTpq2uo=",
|
"narHash": "sha256-EeLoE8n4+QCbteyAsYXxhfr97RFfWL1ga0xwfL6lpKw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "9670de2921812bc4e0452f6e3efd8c859696c183",
|
"rev": "8c8e5389e75a36bee53920de8ee24f017b3ae03e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -438,11 +438,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774738535,
|
"lastModified": 1778501066,
|
||||||
"narHash": "sha256-2jfBEZUC67IlnxO5KItFCAd7Oc+1TvyV/jQlR+2ykGQ=",
|
"narHash": "sha256-T0vB/D3DqGGe+ent3+3jDTIFl2SeXcga3FMcI6AxiMU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "769e07ef8f4cf7b1ec3b96ef015abec9bc6b1e2a",
|
"rev": "c0729fa3f060008080b2124fd0c3b9285d53b393",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -451,16 +451,31 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"jail-nix": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1772137954,
|
||||||
|
"narHash": "sha256-h4MGNbOo7L3RHi4uNFmsg5g17/DHXEfnv/xiG6BrNFQ=",
|
||||||
|
"owner": "~alexdavid",
|
||||||
|
"repo": "jail.nix",
|
||||||
|
"rev": "42b355c38ca63dab4904acc5c0d95f17954a8c9b",
|
||||||
|
"type": "sourcehut"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "~alexdavid",
|
||||||
|
"repo": "jail.nix",
|
||||||
|
"type": "sourcehut"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-homebrew": {
|
"nix-homebrew": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"brew-src": "brew-src"
|
"brew-src": "brew-src"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774720267,
|
"lastModified": 1777250621,
|
||||||
"narHash": "sha256-YYftFe8jyfpQI649yfr0E+dqEXE2jznZNcYvy/lKV1U=",
|
"narHash": "sha256-WynkkG0hdZ5niYPJUbVg7oMfu8MVwGGzKZ6lKmfa+O8=",
|
||||||
"owner": "zhaofengli",
|
"owner": "zhaofengli",
|
||||||
"repo": "nix-homebrew",
|
"repo": "nix-homebrew",
|
||||||
"rev": "a7760a3a83f7609f742861afb5732210fdc437ed",
|
"rev": "aeb2069920742d0d6570089e8b3b8620050bacf2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -474,11 +489,11 @@
|
|||||||
"brew-src": "brew-src_2"
|
"brew-src": "brew-src_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774720267,
|
"lastModified": 1778332591,
|
||||||
"narHash": "sha256-YYftFe8jyfpQI649yfr0E+dqEXE2jznZNcYvy/lKV1U=",
|
"narHash": "sha256-ctJ3ADtugrnbMfMBobA645gCqXVIyHnsCNMkVaIuSiM=",
|
||||||
"owner": "zhaofengli",
|
"owner": "zhaofengli",
|
||||||
"repo": "nix-homebrew",
|
"repo": "nix-homebrew",
|
||||||
"rev": "a7760a3a83f7609f742861afb5732210fdc437ed",
|
"rev": "7d0038b5bb60568ec41f5f4ef5067cd221ca7c0d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -489,11 +504,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774386573,
|
"lastModified": 1777954456,
|
||||||
"narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=",
|
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9",
|
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -519,22 +534,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-screen_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1737753705,
|
|
||||||
"narHash": "sha256-fQeXAeNQrsEUH3fd6RTjN/W+8flJiAFHo7Eya2RT87M=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "e518d4ad2bcad74f98fec028cf21ce5b1e5020dd",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "e518d4ad2bcad74f98fec028cf21ce5b1e5020dd",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"artem_dotfiles": "artem_dotfiles",
|
"artem_dotfiles": "artem_dotfiles",
|
||||||
@@ -544,7 +543,7 @@
|
|||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"nix-homebrew": "nix-homebrew_2",
|
"nix-homebrew": "nix-homebrew_2",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-screen": "nixpkgs-screen_2",
|
"nixpkgs-screen": "nixpkgs-screen",
|
||||||
"systems": "systems_5"
|
"systems": "systems_5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
_: {
|
_: {
|
||||||
homebrew.casks = [
|
homebrew.casks = [
|
||||||
"android-studio"
|
"android-studio"
|
||||||
|
"gimp"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,13 @@
|
|||||||
antigravity
|
antigravity
|
||||||
flutter
|
flutter
|
||||||
android-tools
|
android-tools
|
||||||
|
iterm2
|
||||||
|
|
||||||
zoom-us
|
zoom-us
|
||||||
|
|
||||||
chatgpt
|
chatgpt
|
||||||
|
|
||||||
|
inkscape
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.java = {
|
programs.java = {
|
||||||
|
|||||||
0
legacy/.gitkeep
Normal file
0
legacy/.gitkeep
Normal file
@@ -85,29 +85,47 @@ size: %{size_download}\n"'
|
|||||||
# nix-deploy nas # deploy nas
|
# nix-deploy nas # deploy nas
|
||||||
# nix-deploy test secondary # deploy secondary but do not add to boot
|
# nix-deploy test secondary # deploy secondary but do not add to boot
|
||||||
nix-deploy() {
|
nix-deploy() {
|
||||||
ACTION=switch
|
local action=switch target config cmd r_flake
|
||||||
if [ $# -gt 1 ]; then
|
|
||||||
ACTION=$1
|
if (( $# == 0 )); then
|
||||||
|
# Local deployment.
|
||||||
|
if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
|
cmd=darwin-rebuild
|
||||||
|
r_flake="darwin#darwin-rebuild"
|
||||||
|
else
|
||||||
|
cmd=nixos-rebuild
|
||||||
|
r_flake="nixpkgs#nixos-rebuild"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local run_cmd=($cmd)
|
||||||
|
command -v "$cmd" >/dev/null 2>&1 || run_cmd=(nix run "$r_flake" --)
|
||||||
|
sudo "${run_cmd[@]}" switch --flake . |& nom
|
||||||
|
|
||||||
|
# home-manager switch if exists.
|
||||||
|
local hm_conf="$(whoami)@$(hostname -s)"
|
||||||
|
if [[ "$(nix eval --json ".#homeConfigurations" --apply "x: x ? \"$hm_conf\"" 2>/dev/null)" == "true" ]]; then
|
||||||
|
local hm_run=(home-manager)
|
||||||
|
command -v home-manager >/dev/null 2>&1 || hm_run=(nix run "home-manager#home-manager" --)
|
||||||
|
"${hm_run[@]}" switch --flake .
|
||||||
|
fi
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remote deployment (always NixOS).
|
||||||
|
if (( $# == 1 )); then
|
||||||
|
target=$1
|
||||||
shift
|
shift
|
||||||
fi
|
|
||||||
if which nixos-rebuild &>/dev/null; then
|
|
||||||
COMMAND=(nixos-rebuild)
|
|
||||||
else
|
else
|
||||||
COMMAND=(nix run nixpkgs#nixos-rebuild --)
|
action=$1
|
||||||
fi
|
target=$2
|
||||||
if [ $# -gt 0 ]; then
|
shift 2
|
||||||
TARGET_HOST=$1 # user@host.domain
|
|
||||||
TARGET_WITH_DOMAIN=${TARGET_HOST#*@} # host.domain
|
|
||||||
TARGET=${TARGET_WITH_DOMAIN%%.*} # host
|
|
||||||
shift
|
|
||||||
"${COMMAND[@]}" "${ACTION?}" \
|
|
||||||
--flake ".#${TARGET?}" \
|
|
||||||
--target-host "${TARGET_HOST?}" \
|
|
||||||
--sudo \
|
|
||||||
"$@" |& nom
|
|
||||||
else
|
|
||||||
sudo "${COMMAND[@]}" switch --flake . |& nom
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
config=${${target#*@}%%.*}
|
||||||
|
cmd=(nixos-rebuild)
|
||||||
|
command -v nixos-rebuild >/dev/null 2>&1 || cmd=(nix run "nixpkgs#nixos-rebuild" --)
|
||||||
|
|
||||||
|
"${cmd[@]}" "$action" --flake ".#$config" --target-host "$target" --sudo "$@" |& nom
|
||||||
}
|
}
|
||||||
|
|
||||||
myip() {
|
myip() {
|
||||||
|
|||||||
Reference in New Issue
Block a user