gvolpe / blog-comments

Principled Software Craftsmanship (source moved permanently to https://github.com/gvolpe/gvolpe.github.io)
https://gvolpe.com/blog/
MIT License
2 stars 1 forks source link

[Comments] - Flakes: NixOS and Home Manager migration #16

Open gvolpe opened 2 years ago

Awan commented 1 year ago

You can run home-manager switch --flake directly from any where and it will switch as well.

Awan commented 1 year ago

asciicast

gvolpe commented 1 year ago

@Awan I use nix build directly these days 😉 https://github.com/gvolpe/nix-config/blob/master/switch#L7

Awan commented 1 year ago

Just a new installation using flakes from my nix repo mithu branch

gvolpe commented 1 year ago

nixos-install --flake is very cool for fresh installations :)

I haven't had the need to perform one in a long time (only have one working laptop right now), but definitely something I'd recommend doing. This blog post is probably a bit dated, as that was written when I first migrated to flakes...

Awan commented 1 year ago

yeah, its cool. I tried it yesterday on my laptop as I was moving to unstable. It worked like a charm. All I had to do is clone my repo, create a new branch, stripped down it for fast installation and then pushed back to gh. I just added my encrypted drive UUID and then nixos-install --flake github:Awan/nix/mithu#x1c. mithu is the branch if you don't want to use default master/main branch...

On 11/08, Gabriel Volpe wrote:

nixos-install --flake is very cool for fresh installations :)

I haven't had the need to perform one in a long time (only have one working laptop right now), but definitely something I'd recommend doing. This blog post is probably a bit dated, as that was written when I first migrated to flakes...

-- Reply to this email directly or view it on GitHub: https://github.com/gvolpe/blog/issues/16#issuecomment-1211650488 You are receiving this because you were mentioned.

Message ID: @.***>

Abdullah Khabir

Cyber Security Analyst

https://abdullah.today

C20F 2707 3025 2569 BAC5 534B 7820 6670 C19D 1580

Awan commented 1 year ago

Here you can use sudo -E nixos-rebuild --flake .#hostname and it will save you from activation next step ;-)

gvolpe commented 1 year ago

@Awan I think you got the wrong line, you're pointing to the Home Manager activation, you don't need sudo for that.

Awan commented 1 year ago

@gvolpe yeah, I just noticed it. That rebuild_system is what I was mentioning.

gvolpe commented 1 year ago

There's no activation there, though 🤔 It's just sudo nixos-rebuild switch --flake .#tongfang-amd