1. No use of dotfiles
I don't like dotfiles because they're difficult to debug and are tend to be bloated, inefficient and complicated. When using home-manager with nix, those are managed by a file named home.nix so it's very clean. It's also error-free as long as options are set appropriately. Maybe my dotfiles management is just terrible, if you know any good way to do this on Windows, please tell me.
2. Everything is configurable from a single file
On NixOS and MacOS with nix-darwin, you can configure basically everything, from package management to system configuration, in a file: configuration.nix
I would like to do the same on Windows. One thing I considered is to make a powershell script that configures everything on execution.
ChatGPT says that I can use something called [Desired State Configuration](https://learn.microsoft.com/en-us/powershell/dsc/getting-started/wingettingstarted?view=dsc-1.1), but as far as I can see the documentation, it's not something I'm looking for. (correct me if I'm wrong)
3. Containered environment for development
On Nix, you can declare everything necessary to build a package so you don't need to install packages on your system by yourself. I don't want to put myself into a dependency hell anymore. But I have an idea for this: using docker. Docker separates developing environment from host's system so there would be no pre-installed dependencies. It would be good and I'm considering learning docker. Next thing I'm considering is to use something like [nx](https://nx.dev/). If you have better ideas, please tell me.
This is pretty much everything I need for my next Windows environment. Every small tips or tricks are welcome.
That way you contain the inherent mess that a Windows install will eventually devolve into. You also get the ability to snapshot states of your windows install, which makes it possible to mess around a bit and then roll back to a previous state.
You didn't tell what Windows software you want to run, but depending on your needs you could even do a pci-passthrough in this setup.
I do not recommend Ansible as someone else did. You will spend your days fighting a mix of yaml and Jinja. You will end up looking at Python errors because there are no static types. Never again.
Hopefully not relevant for uni work, but still worth mentioning.
If anyone is thinking about using ansible, I would suggest approaching it like a software project.
Define specialised roles, create test playbooks for those individual roles, use these roles to compose more complex playbooks, and offload logic to custom ansible modules that are written in python. This way you catch template problems early and won't wrestle with heavy logic in the template or playbook layer.
Came here to say exactly this, and lo, top comment.
Don't let windows anywhere near you actual hardware.
Install WSL2, do everything development under WSL2. It works very well. It even has x server forwarding now, and supports CUDA. No need for docker, simply use VSCode and the Remote SSH extension works natively with WSL2.
Just make sure to get at least 32gb of ram (most windows laptops you can upgrade the ram).
And I think laptops with 32gb of RAM are too expensive for me.
Having said that my attempt to bear a corporate windows on a corporate laptop with WSL2 was terrible and I ended up installing linux on it and using the online version of office 365. I would run Linux as a host OS and a windows VM for anything specific to windows. There are ways to share filesystems nowadays.
ram is cheap. brand new things are too expensive. check ebay.
Whenever you wanna develop, just launch VSCode.
Once you are done with school, just install linux in it fully.
I was talking about Thinkpad X13 Gen 4, but yours seems to be better in terms of cost. I don’t really like numerical pads, though.
The only things I'd suggest as worth it are:
- separate "data" partition on D:, backed up
- back up %APPDATA% and %USERPROFILE%
- learn one of chocolatey or winget
- WSL2 is a Linux VM; "git bash" is surprisingly good at providing a hybrid environment on the Windows filesystem
- otherwise, just let everything dump itself into C:\Program Files and don't worry too much about it. This is what everyone else will be doing.
It used to be beneficial to do regular reinstalls, but those days are long past. I'd expect you to be able to make it through a 3 year course without having a broken installation incident.
(Not clear what tooling you'll be using? Visual Studio? VSCode? What language(s)?)
Bob is a homage to an old (deceased sadly) family friend, he worked in aerospace in the 1980's and since he knew I was into computers he was kind enough to give me his deprecated kit - so my first PC had a partition named Bob and I've continued it ever since :).
Without Bob I'd most likely be working a near minimum wage job doing something I hated - he gave me access to an IBM PC Compatible when no way could my family have afforded one plus he was a programmer so he gave me books (those paper things we had before the internet).
1 machine at a time.
A configuration allows you to setup a new machine quickly and consistently when one breaks, get stolen, or lost in an inconvenient time.
More importantly, as a developer you want a clean and consistent development environment so that you do not depend on anything accidentally installed on the machine.
In a previous project, development was tied to a specific machine and until I fixed it, the team simply could not migrate to a new machine if anything happened to it.
On top of that you are unlikely to do and need the exact same thing when you will be switching hardware (considering how evolution has slowed down); and new hardware is very often motivated by a change of activity (so the relevant specs and setup te d to change).
Don’t overthink it, just install a plain old windows, use VMs to test stuff and fix things as you go along. Nowadays Windows is stable enough that you are unlikely to need much fixing until you are ready to change the hardware anyway…
%APPDATA% lives in %USERPROFILE% as far as I can tell.
> - separate "data" partition on D:, backed up
Since you already back up your %USERPROFILE%, which supposedly lives on C:, what benefit is there in having "data" on a separate partition?
What software do you need to run?
The second risk is if they want to control your setup in some way with some sort of fleet management software. Windows VM inside another OS should be fine with that, but you never know.
Your escape hatch may be a big windows machine 16G+, preferably 24G minimum, and run your linux env in WSL2, android in WSA, or use Hyper-V, etc.
Most probably his UNI just do not want to hear excuses like "but I am running X and it is not working on my Operating System!" and have to deal with supporting people on stuff they don't know / don't want to know.
Set up WSL2 for all your Nix and fancy configuration needs. It acts and works like a Linux VM, except with Windows 11 you can also run GUI programs. Set up Windows like any normal Windows user would (pay special attention to the disk encryption not being enabled properly if you don't log in with a Microsoft account) and use it as intended.
Windows does not do dotfiles. Well, some Linux programs do, because they don't really care about user experience, but in general everything configuration related will be stored in %appdata% and the registry.
There is no single file configuration for Windows. There are group policy editors that can control a lot of settings, but what you're looking for doesn't exist and existing tools aren't designed for Windows. Trying to make them work will only frustrate you.
As for containers, WSL2 and Docker work fine. They're running on a Linux VM, so they work as well as they do on Linux, barring some minor overhead from networking and file system integrations.
Alternatively, run Windows in a VM if you already have the Macbook. See how far you'll come before you need some kind of hardware acceleration, you may just be able to use a VM for the few Windows only tools you'll actually he using.
Hopefully the latest versions of windows fix these issues. Too many to detail, I can only say I'm on a very locked down, managed version of windows and thankful to have an administrator account for my machine.
Locking Windows down does add some challenges, though. The close integration allows for WSL2 to become a method to bypass some restrictions, so it makes sense that strictly configured MDM solutions will cause issues.
That doesn't seem to apply to OP, though.
WSL2 + VSCode is enough for most of my use cases. Get Power Toys. You can now create a dev drive that has better performance with many small files like in node, if you are not using WSL. Multiple Desktop/Monitor is so much better than Mac. Need to spend couple of hours initially to tune it to my liking, after that it is mostly smooth run. I thought using Choco/WinGet initially but initial installation by going to each site isn't that big a pain. Go with lot of RAM if using Docker.
Honestly, there's just not a solution you're going to be happy with, coming from Nix. Windows is like categorically maybe the OS most fundamentally unsuited for folks who appreciate sane ways of managing computers.
If you only need it for one piece of software I'd absolutely use wine or a VM.
Tell that to the billion-or-so Windows computers that are straightforwardly managed and remoted-into with Active Directory, SMB, and Remote Desktop. Not to mention group policies, registry files, and PowerShell.
Powershell remoting achieves similar management objectives to ssh but is a very different interface.
So it’s with curiosity that I read this, but I don’t understand what you’re referring to about configuration. Do you mean setting for networking, peripherals and reg edits to get rid of those darn folders for ‘games’ and ‘videos’?
As much as I try to make my own improvements and insurance against downtime, I find I’m spending a lot of time to only discover its best to let Windows do its thing.
Basically everything, including ones that you mentioned. Networking, for example, have these options (link below)
https://search.nixos.org/options?channel=23.11&from=0&size=5...
peripherals are typically managed by “home-manager”
Registry in this context is specific to Windows so I don’t know. Environment variables are configurable.
Dual-booting requires partitioning so I personally don’t really like it.
Not necessarily. As I hinted in the OP, I'm installed on separate drives. My Lenovo tiny has 2x M.2 SSD and 1x 2.5” SSD all in a 7”x7”x1.5” format.
And I don’t think you can avoid partitioning. Windows makes 4 partitions automatically—unless you’re making multiple installations, then it doesn’t duplicate boot (logically problematic) and WinRE
Any guides on using nix-darwin for system configuration and etc? Ive been using it for a while and Id love to learn more!
There are many software out there that requires configurations for better experience, so it’s an inevitable problem.
I'm assuming most people here aren't in the precariat like me. If you are, then get a used Windows laptop, they're even cheaper.
Edit: sorry, missed the portion of the parent comment mentioning used.
You can script windows things with powershell and package managers — which you can test on Windows VMs.
Just make the VMs your primary work machines, and leave the host are unmodified as possible unless absolutely necessary.
Alternatively, you can use a Linux host for VMs.
Then follow the advice of being disciplined about separating data and os/programs and just use backups.
Then use wsl2 with nixos as your main dev env and backup/src control your configs.
This setup is really nice and has the benefit of being able to run just about anything.
If you really want to go nuts you could setup a lvl1 hypervisor like proxmox and run All the OSes. I have a machine setup like this and run macos, windows 7-11, various linux. The one you use for video games you can do hardware pass through to get native video performance. Overkill but fun!
Backups are a good thing, but most kids do their schoolwork in the cloud. Possibly the greatest risk is not software related, but either mechanical damage or theft. And battery death. Don't treat a portable appliance as your most prized possession.
And this is also true of people in general: There doesn't seem to be a correlation between how fussy someone is about keeping their computer just right, and actually getting reliable use out of it. So part of the process is deciding for yourself whether you tend to need more computer management, or less, than the average person.
Maybe the Windows requirement is for running anti-cheating software? There is the chance of you being required to install some bizarre spyware. That kind of stuff can also be highly platform specific, which is usually a sign of it being poorly written.
Back in the day I used "Norton Ghost" to create a full image of a just-installed windows just in case I needed to go back in time. Windows includes a snapshot feature built-in but I did not really trust it. These days you can use a "sysprep" tool [2] to create a similar system snapshot. Make a partition and keep everything you don't want deleted on drive D: or something :-).
--
1: https://www.jetpack.io/devbox
2: like https://www.ntlite.com or https://fogproject.org
IF NOT then use ntfs snapshots extensively to being able to recover and keep data on a *nix host well managed.
Windows have proprietary automation but being designed as an "endpoint OS", meaning a value-less thing you deploy mostly in a default state without much customization there is not much you can do at a domestic level. BTW if an Uni in 2024 demand Windows specifically to students I doubt can be really a good choice...
Do something like this: https://christitus.com/windows-11-perfect-install/
And avoid too many registry tweaks or other unsupported hacks as they will likely break security updates or the Windows system itself.
If you need containers, Docker Desktop + WSL works great.
Or run Linux and use Windows in a virtual machine for the specific things you need Windows for.
Run it in its own silo and use the magic of networking for interfacing with your preferred OS.
Architecturally:
Windows <---> Network Protocols <---> Your Preferred OS
Basically, use the ubiquitous API's rather than trying to write your own. The API's are built into each OS to solve the exact problem.Also, hardware is a useful abstraction. Two laptops make it easier to partition the dimensions of your daily life. And there is nothing magical bout them. Computers are cattle not pets.
Good luck.
While it's good to have windows ready, keep in mind this is often not strictly true, but rather a strong recommendation. I survived at uni while translating MATLAB exercises to Octave, compiling windows stuff for Wine, etc. If you set up dual booting, you'll likely be able to spend 99% of your time in whatever system you want.
Forget about configuration as code in pure Windows, been there, it's a waste of your time.
Also I'm not 100% positive but you might need a Windows Pro license to run Docker in Windows (something something virtualization can't recall correctly)
I keep a git repository with all my dot files in it[1]. This seems to work the best. It has a Windows folder as well, and I copy that out whenever I need to set up Windows.
A lot of people like using WSL but I hate how it hogs on my memory. Hyper-V is a terrible virtualization engine for consumer-grade use cases because it can't thin provision RAM. If I need to use docker, I will spin up a small Linux VM using vagrant[3] with Virtualbox[4] and put Docker on there. Vagrant is an extremely underrated tool in my opinion, particularly in a Windows context.
I use scoop[5] for package management. Typically I will scoop install msys2 and then pin it so that it doesn't get blown away by the next upgrade.
Then I basically do all of my development inside of msys2. I can get most things running in there without virtualization. In my case that means sbcl and roswell for common lisp, senpai for irc, and tmux and nvim for sanity. Msys2 uses the pacman package manager and this is good enough.
All In all, I set up my Windows machine affresh after a while of not using it and it took me about 3 hours. Most of that time was just getting through upgrades though, I felt like it was pretty fast.
1: https://git.sr.ht/~skin/dotfiles
notepad $PROFILE
From there you can configure environment variables, path, etc.
1. Run Windows on Linux by using VM
for the applications you can’t run on Linux
Risks:
* some softwares may attempt to detect VMs and refuse running
* Anything what needs to touch hardware may not work.
2. separate "data" partition on D:
3. back up %APPDATA% and %USERPROFILE%
4. learn chocolatey, scoop or winget
Winget should be good enough
5. Don’t worry about C:\Program Files
6. (Mixed) Use/Don’t use Ansible (or saltstack/salt)
Use:
* Allows you to setup a new machine quickly and consistently when one breaks, get stolen, or lost in an inconvenient time.
* You can get a clean and consistent development environment so that you do not depend on anything accidentally installed on the machine.
* If you define specialised roles, create test playbooks for those individual roles, use these roles to compose more complex playbooks, and offload logic to custom ansible modules that are written in python, you won't wrestle with heavy logic in the template or playbook layer.
* installing software and pulling some configs and scripts down is fine
Don’t use:
* You will spend your days fighting a mix of yaml and Jinja.
* You will end up looking at Python errors because there are no static types.
* errors are cryptic.
7. Use WSL2
You need 32gb of ram, but ram is cheap so choose a good thinkpad
8. Debloat with Recommended Tweaks
Run
irm christitus.com/win | iex
from Administrator Terminal (Powershell)
The link leads to https://raw.githubusercontent.com/ChrisTitusTech/winutil/mai...
VirusTotal
https://www.virustotal.com/gui/file/709834b0e003b6bb546cf16e...
9. Get [PowerToys](https://github.com/microsoft/PowerToys)
10. Use Devbox for containered environment
11. Dual-Booting Linux and Windows
If you use physically separated drives, you don’t need partitioning.
12. Dedicated Windows machine for class
Yes it sure would be the cleanest solution but I prefer one device for everything
13. keep a git repository with all dot files in it
Many people suggested that using virtualization is the way, otherwise just let Windows be Windows.
Also, backing up seems to be a good practice.
I’m planning to write a blog about this, if it worked.
Again, thank you all for the helps!
Get an off-lease refurb laptop (Newegg has tons of these [0], $300 can get you a decent 15" Lenovo / HP / Dell with SSD, 32GB ram, i7, etc)
Wipe it and install Windows 10 LTSC [1], install all known required university software, Git for Windows, Chocolatey, text editor(s) of choice, etc.
Image the main drive as a fresh starting point for when the machine gets hosed.
If you NEED real Linux, install those to VMs on a secondary drive or partition (I like VirtualBox as host but there are others) -- better to virtualize the least-demanding OS rather than the most.
Sync your browser bookmarks/history to the cloud.
Keep all of your code in separate private repos so they're backed up and you can pull down if you need to.
While on Windows, if you're trying to do Linux things, just use Git Bash. I doubt you'll ever need to touch Powershell or anything like that in general usage.
I wouldn't waste my time with Docker either -- it's dreadfully slow when using WSL, usable if you go back to regular Hyper-V and crank the RAM, but try as I might, I just have never found a scenario where it felt like the right solution to a problem on Windows.
It's also never a bad idea to find ways to separate your concerns -- my daily setup is a Windows 10 desktop, a Mac mini and a Linux desktop all in a closet, Windows on the main monitor, MacOS on the monitor to the right, keyboard and mouse shared via Synergy, and I SSH into the Linux box from Windows. I do most things on Windows, Mac things on the Mac, Linux things on Linux, but it's ergonomic and feels like one system (to me).
And do pick up all the other tips in this discussion -- good advice in there on snapshots, what to back up, etc.
There's no "correct configuration" for any of this stuff, you'll find a combo that feels good to you. Keep it simple and lean and you'll be fine. I've been using Windows as my primary desktop OS since 3.11 for Workgroups, it can be a fickle lover, sure, but Windows is incredibly capable in 2024.
Links:
[0] https://www.newegg.com/p/pl?N=4131%204016%20600566986%201000...